Merge pull request #765 from nabinhait/hotfix

fixes in event handling for button
This commit is contained in:
Anand Doshi 2014-08-11 15:30:08 +05:30
commit 48544ab799

View file

@ -525,7 +525,7 @@ frappe.ui.form.ControlButton = frappe.ui.form.ControlData.extend({
},
onclick: function() {
if(this.frm && this.frm.doc) {
if(this.frm.script_manager.get_handlers(this.df.fieldname, this.doctype, this.docname)) {
if(this.frm.script_manager.get_handlers(this.df.fieldname, this.doctype, this.docname).length) {
this.frm.script_manager.trigger(this.df.fieldname, this.doctype, this.docname);
} else {
this.frm.runscript(this.df.options, this);