From 11a5ba64ddd8d2ee56c1542ebe5218c6da901dfe Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 9 Aug 2012 11:30:21 +0530 Subject: [PATCH 1/2] fixed bug in depends_on: hidden property of a docfield should have value as 0 or 1 --- public/js/all-app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/js/all-app.js b/public/js/all-app.js index bd5af85762..3c35b8344b 100644 --- a/public/js/all-app.js +++ b/public/js/all-app.js @@ -1792,7 +1792,7 @@ if(me.fields_dict['trash_reason']){if(me.doc.trash_reason&&me.doc.docstatus==2){ if(me.meta.autoname&&me.meta.autoname.substr(0,6)=='field:'&&!me.doc.__islocal){var fn=me.meta.autoname.substr(6);set_field_permlevel(fn,1);}} _f.Frm.prototype.refresh_dependency=function(){var me=this;var doc=locals[this.doctype][this.docname];var has_dep=false;for(fkey in me.fields){var f=me.fields[fkey];f.dependencies_clear=true;if(f.df.depends_on){has_dep=true;}} if(!has_dep)return;for(var i=me.fields.length-1;i>=0;i--){var f=me.fields[i];f.guardian_has_value=true;if(f.df.depends_on){var v=doc[f.df.depends_on];if(f.df.depends_on.substr(0,5)=='eval:'){f.guardian_has_value=eval(f.df.depends_on.substr(5));}else if(f.df.depends_on.substr(0,3)=='fn:'){f.guardian_has_value=me.runclientscript(f.df.depends_on.substr(3),me.doctype,me.docname);}else{if(v||(v==0&&!v.substr)){}else{f.guardian_has_value=false;}} -if(f.guardian_has_value){f.df.hidden=false;f.refresh()}else{f.df.hidden=true;f.refresh()}}}} +if(f.guardian_has_value){f.df.hidden=0;f.refresh()}else{f.df.hidden=1;f.refresh()}}}} _f.Frm.prototype.setnewdoc=function(docname){if(this.opendocs[docname]){this.docname=docname;return;} Meta.make_local_dt(this.doctype,docname);this.docname=docname;var me=this;var viewname=docname;if(this.meta.issingle)viewname=this.doctype;this.runclientscript('onload',this.doctype,this.docname);this.is_editable[docname]=1;if(this.meta.read_only_onload)this.is_editable[docname]=0;this.opendocs[docname]=true;} _f.Frm.prototype.edit_doc=function(){this.is_editable[this.docname]=true;this.refresh();} From c4df355edc9cb41cd56201650180cc9b1168e0bd Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 9 Aug 2012 11:33:56 +0530 Subject: [PATCH 2/2] removed msgprint in get_pos_details of sales invoice --- erpnext/accounts/doctype/sales_invoice/sales_invoice.py | 1 - 1 file changed, 1 deletion(-) diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py index 6a7fb0186e..ec327c7e1b 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py @@ -209,7 +209,6 @@ class DocType(TransactionBase): if ret['warehouse']: actual_qty = webnotes.conn.sql("select actual_qty from `tabBin` where item_code = '%s' and warehouse = '%s'" % (args['item_code'], ret['warehouse'])) ret['actual_qty']= actual_qty and flt(actual_qty[0][0]) or 0 - msgprint(ret) return ret def get_barcode_details(self, barcode):