From 7ff14ede3c1d48efdc5ee28c43d60907c65e8ebc Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 21 Mar 2012 15:33:50 +0530 Subject: [PATCH 1/8] Update erpnext/stock/doctype/stock_entry/stock_entry.txt --- erpnext/stock/doctype/stock_entry/stock_entry.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.txt b/erpnext/stock/doctype/stock_entry/stock_entry.txt index 4f524aa5f1f..b7790f7a54e 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.txt +++ b/erpnext/stock/doctype/stock_entry/stock_entry.txt @@ -451,7 +451,7 @@ # DocField { - 'depends_on': u"eval:doc.purpose == 'Others'", + 'depends_on': u"eval:doc.purpose == 'Other'", 'doctype': u'DocField', 'fieldname': u'bom_no', 'fieldtype': u'Link', @@ -463,7 +463,7 @@ # DocField { 'colour': u'White:FFF', - 'depends_on': u"eval:doc.purpose == 'Others'", + 'depends_on': u"eval:doc.purpose == 'Other'", 'description': u'Select "Yes" if stock is maintained and tracked for sub-assembly items. Select "No" if you want child items of sub-assembly for material transfer.', 'doctype': u'DocField', 'fieldname': u'consider_sa_items_as_raw_materials', From ac9adff1bbb33abc5a9de517e9717f26a18b234f Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 21 Mar 2012 15:35:04 +0530 Subject: [PATCH 2/8] Update erpnext/stock/doctype/stock_entry/stock_entry.py --- erpnext/stock/doctype/stock_entry/stock_entry.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.py b/erpnext/stock/doctype/stock_entry/stock_entry.py index c50a31b785d..96642d0dc2b 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.py +++ b/erpnext/stock/doctype/stock_entry/stock_entry.py @@ -231,7 +231,7 @@ class DocType: bom_no = pro_obj.doc.bom_no fg_qty = (self.doc.process == 'Backflush') and flt(self.doc.fg_completed_qty) or flt(pro_obj.doc.qty) consider_sa_items_as_rm = pro_obj.doc.consider_sa_items - elif self.doc.purpose == 'Others': + elif self.doc.purpose == 'Other': self.validate_bom_no() bom_no = self.doc.bom_no fg_qty = self.doc.fg_completed_qty @@ -249,7 +249,7 @@ class DocType: sw = '' tw = cstr(pro_obj.doc.fg_warehouse) fg_item_dict = {cstr(pro_obj.doc.production_item) : [self.doc.fg_completed_qty, pro_obj.doc.description, pro_obj.doc.stock_uom]} - elif self.doc.purpose == 'Others' and self.doc.bom_no: + elif self.doc.purpose == 'Other' and self.doc.bom_no: sw, tw = '', '' item = sql("select item, description, uom from `tabBill Of Materials` where name = %s", self.doc.bom_no, as_dict=1) fg_item_dict = {item[0]['item'] : [self.doc.fg_completed_qty, item[0]['description'], item[0]['uom']]} @@ -427,7 +427,7 @@ class DocType: if cstr(d.s_warehouse) != cstr(pro_obj.doc.wip_warehouse): msgprint("As Item %s is Raw Material. Source Warehouse should be same as WIP Warehouse %s in Production Order %s, at Row No %s. " % ( cstr(d.item_code), cstr(pro_obj.doc.wip_warehouse), cstr(pro_obj.doc.name), cstr(d.idx))) raise Exception - if d.fg_item and (self.doc.purpose == 'Others' or self.doc.process == 'Backflush'): + if d.fg_item and (self.doc.purpose == 'Other' or self.doc.process == 'Backflush'): fg_qty = flt(fg_qty) + flt(d.transfer_qty) d.save() From c37cb4d7c33b0274bf025cbd5aee82a4dde4764b Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 21 Mar 2012 15:35:41 +0530 Subject: [PATCH 3/8] Update erpnext/stock/doctype/stock_entry/stock_entry.js --- erpnext/stock/doctype/stock_entry/stock_entry.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.js b/erpnext/stock/doctype/stock_entry/stock_entry.js index 99eab91e828..3593fa0c3c3 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.js +++ b/erpnext/stock/doctype/stock_entry/stock_entry.js @@ -25,14 +25,14 @@ var cfn_set_fields = function(doc, cdt, cdn) { lst = ['supplier','supplier_name','supplier_address','customer','customer_name','customer_address']; hide_field(lst); - if (doc.purpose == 'Production Order' || doc.purpose == 'Others'){ + if (doc.purpose == 'Production Order' || doc.purpose == 'Other'){ unhide_field('Get Items'); hide_field(['from_warehouse', 'to_warehouse','purchase_receipt_no','delivery_note_no', 'sales_invoice_no','Warehouse HTML', 'transporter', 'is_excisable_goods', 'excisable_goods']); if (doc.purpose=='Production Order') unhide_field(['production_order', 'process']); doc.from_warehouse = ''; doc.to_warehosue = ''; - if (doc.process == 'Backflush' || doc.purpose == 'Others'){ + if (doc.process == 'Backflush' || doc.purpose == 'Other'){ unhide_field('fg_completed_qty'); } else{ From 2a68bdf23139760f5d911c168f9dc7a1ea0bf1b6 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 21 Mar 2012 15:50:14 +0530 Subject: [PATCH 4/8] Update erpnext/stock/doctype/stock_entry/stock_entry.txt --- erpnext/stock/doctype/stock_entry/stock_entry.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.txt b/erpnext/stock/doctype/stock_entry/stock_entry.txt index b7790f7a54e..9792fc91c53 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.txt +++ b/erpnext/stock/doctype/stock_entry/stock_entry.txt @@ -456,7 +456,7 @@ 'fieldname': u'bom_no', 'fieldtype': u'Link', 'label': u'BOM No', - 'options': u'Bill of Materials', + 'options': u'Bill Of Materials', 'permlevel': 0 }, From 830b8baa9dadcbac9a49b92be5daf02bfafad387 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 21 Mar 2012 15:56:22 +0530 Subject: [PATCH 5/8] update bom no options in stock entry --- erpnext/patches/jan_mar_2012/update_se_fld_options.py | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 erpnext/patches/jan_mar_2012/update_se_fld_options.py diff --git a/erpnext/patches/jan_mar_2012/update_se_fld_options.py b/erpnext/patches/jan_mar_2012/update_se_fld_options.py new file mode 100644 index 00000000000..8e25237f92e --- /dev/null +++ b/erpnext/patches/jan_mar_2012/update_se_fld_options.py @@ -0,0 +1,3 @@ +def execute(): + import webnotes + webnotes.conn.sql("update `tabDocField` set options = 'Bill Of Materials' where fieldname = 'bom_no' and parent = 'Stock Entry'") From 93162f603d64907879abb5715dd816f1ead27dc6 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 21 Mar 2012 16:02:44 +0530 Subject: [PATCH 6/8] update bom no options in stock entry --- erpnext/patches/jan_mar_2012/update_se_fld_options.py | 3 +++ erpnext/patches/patch_list.py | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/erpnext/patches/jan_mar_2012/update_se_fld_options.py b/erpnext/patches/jan_mar_2012/update_se_fld_options.py index 8e25237f92e..fab0b198278 100644 --- a/erpnext/patches/jan_mar_2012/update_se_fld_options.py +++ b/erpnext/patches/jan_mar_2012/update_se_fld_options.py @@ -1,3 +1,6 @@ def execute(): import webnotes webnotes.conn.sql("update `tabDocField` set options = 'Bill Of Materials' where fieldname = 'bom_no' and parent = 'Stock Entry'") + + from webnotes.modules.module_manager import reload_doc + reload_doc('stock', 'doctype', 'stock_entry') diff --git a/erpnext/patches/patch_list.py b/erpnext/patches/patch_list.py index db1daf1f00e..3bf4b6a3ae6 100644 --- a/erpnext/patches/patch_list.py +++ b/erpnext/patches/patch_list.py @@ -202,5 +202,10 @@ patch_list = [ 'patch_file': 'update_purpose_se', 'description': 'Purpose SE: Others to Other' }, + { + 'patch_module': 'patches.jan_mar_2012', + 'patch_file': 'update_se_fld_options', + 'description': 'Purpose SE: Others to Other' + }, ] From d551281cbe45ace3c5eb6cb3f5070ebab2c14e05 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 21 Mar 2012 16:57:08 +0530 Subject: [PATCH 7/8] cdt not defined fixed --- erpnext/accounts/doctype/payable_voucher/payable_voucher.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/payable_voucher/payable_voucher.js b/erpnext/accounts/doctype/payable_voucher/payable_voucher.js index 99bd24c6b89..f8ef91ec3e9 100644 --- a/erpnext/accounts/doctype/payable_voucher/payable_voucher.js +++ b/erpnext/accounts/doctype/payable_voucher/payable_voucher.js @@ -162,7 +162,7 @@ cur_frm.cscript.is_opening = function(doc, dt, dn) { // Recalculate Button // ------------------- -cur_frm.cscript['Recalculate'] = function(doc, dt, dn) { +cur_frm.cscript['Recalculate'] = function(doc, cdt, cdn) { cur_frm.cscript['Calculate Tax'](doc,cdt,cdn); calc_total_advance(doc,cdt,cdn); } From 653536596d698747578e5ca79808917e12be7a8e Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 21 Mar 2012 17:07:42 +0530 Subject: [PATCH 8/8] fax added in address display --- erpnext/utilities/transaction_base.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/erpnext/utilities/transaction_base.py b/erpnext/utilities/transaction_base.py index ee23c75fc9b..032b52faa63 100644 --- a/erpnext/utilities/transaction_base.py +++ b/erpnext/utilities/transaction_base.py @@ -81,12 +81,12 @@ class TransactionBase: cond = 'name="%s"' % address_name if is_shipping_address: - details = webnotes.conn.sql("select name, address_line1, address_line2, city, country, pincode, state, phone from `tabAddress` where %s and docstatus != 2 order by is_shipping_address desc limit 1" % cond, as_dict = 1) + details = webnotes.conn.sql("select name, address_line1, address_line2, city, country, pincode, state, phone, fax from `tabAddress` where %s and docstatus != 2 order by is_shipping_address desc limit 1" % cond, as_dict = 1) else: - details = webnotes.conn.sql("select name, address_line1, address_line2, city, country, pincode, state, phone from `tabAddress` where %s and docstatus != 2 order by is_primary_address desc limit 1" % cond, as_dict = 1) + details = webnotes.conn.sql("select name, address_line1, address_line2, city, country, pincode, state, phone, fax from `tabAddress` where %s and docstatus != 2 order by is_primary_address desc limit 1" % cond, as_dict = 1) extract = lambda x: details and details[0] and details[0].get(x,'') or '' - address_fields = [('','address_line1'),('\n','address_line2'),('\n','city'),(' ','pincode'),('\n','state'),('\n','country'),('\nPhone: ','phone')] + address_fields = [('','address_line1'),('\n','address_line2'),('\n','city'),(' ','pincode'),('\n','state'),('\n','country'),('\nPhone: ','phone'),('\nFax: ', 'fax')] address_display = ''.join([a[0]+extract(a[1]) for a in address_fields if extract(a[1])]) if address_display.startswith('\n'): address_display = address_display[1:]