diff --git a/frappe/core/doctype/report/test_records.json b/frappe/core/doctype/report/test_records.json new file mode 100644 index 0000000000..a2dc7fb71f --- /dev/null +++ b/frappe/core/doctype/report/test_records.json @@ -0,0 +1,9 @@ +[ + { + "doctype": "Report", + "name": "_Test Report 1", + "report_type": "Query Report", + "is_standard": "No", + "ref_doctype": "Event" + } +] diff --git a/frappe/core/doctype/report/test_report.py b/frappe/core/doctype/report/test_report.py new file mode 100644 index 0000000000..a1f65fb682 --- /dev/null +++ b/frappe/core/doctype/report/test_report.py @@ -0,0 +1,10 @@ +# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors +# See license.txt + +import frappe +import unittest + +test_records = frappe.get_test_records('Report') + +class TestReport(unittest.TestCase): + pass diff --git a/frappe/public/js/frappe/form/control.js b/frappe/public/js/frappe/form/control.js index 7c96c5f0f9..f331a47e3d 100644 --- a/frappe/public/js/frappe/form/control.js +++ b/frappe/public/js/frappe/form/control.js @@ -596,6 +596,10 @@ frappe.ui.form.ControlAttach = frappe.ui.form.ControlData.extend({ }) }, onclick: function() { + if(this.doc && this.doc.__islocal) { + frappe.msgprint(__("Please save the document before uploading.")); + return; + } if(!this.dialog) { this.dialog = new frappe.ui.Dialog({ title: __(this.df.label || __("Upload")), diff --git a/frappe/public/js/frappe/ui/messages.js b/frappe/public/js/frappe/ui/messages.js index 4d6e5c0f26..838c5a61c7 100644 --- a/frappe/public/js/frappe/ui/messages.js +++ b/frappe/public/js/frappe/ui/messages.js @@ -53,7 +53,7 @@ frappe.get_value = function(field, callback) { } var msg_dialog=null; -function msgprint(msg, title) { +frappe.msgprint = function(msg, title) { if(!msg) return; if(msg instanceof Array) { @@ -104,6 +104,8 @@ function msgprint(msg, title) { return msg_dialog; } +var msgprint = frappe.msgprint; + // Floating Message function show_alert(txt, seconds) { if(!$('#dialog-container').length) {