From ed02a85184ce5a237deb2f9c25da4397458b21b2 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 15 May 2012 12:15:19 +0530 Subject: [PATCH 1/4] fixed issue --- erpnext/selling/doctype/quotation/quotation.py | 2 +- erpnext/selling/doctype/sales_order/sales_order.py | 2 +- erpnext/stock/doctype/delivery_note/delivery_note.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/erpnext/selling/doctype/quotation/quotation.py b/erpnext/selling/doctype/quotation/quotation.py index 511a74dc22..2aeecc4267 100644 --- a/erpnext/selling/doctype/quotation/quotation.py +++ b/erpnext/selling/doctype/quotation/quotation.py @@ -83,7 +83,7 @@ class DocType(TransactionBase): if doc.fields.get('item_code'): arg = {'item_code':doc.fields.get('item_code'), 'income_account':doc.fields.get('income_account'), 'cost_center': doc.fields.get('cost_center'), 'warehouse': doc.fields.get('warehouse')}; - ret = obj.get_item_defaults(arg, self) + ret = obj.get_item_defaults(arg) for r in ret: if not doc.fields.get(r): doc.fields[r] = ret[r] diff --git a/erpnext/selling/doctype/sales_order/sales_order.py b/erpnext/selling/doctype/sales_order/sales_order.py index 7a19528153..aece1d500e 100644 --- a/erpnext/selling/doctype/sales_order/sales_order.py +++ b/erpnext/selling/doctype/sales_order/sales_order.py @@ -100,7 +100,7 @@ class DocType(TransactionBase): if doc.fields.get('item_code'): arg = {'item_code':doc.fields.get('item_code'), 'income_account':doc.fields.get('income_account'), 'cost_center': doc.fields.get('cost_center'), 'warehouse': doc.fields.get('warehouse')}; - ret = obj.get_item_defaults(arg, self) + ret = obj.get_item_defaults(arg) for r in ret: if not doc.fields.get(r): doc.fields[r] = ret[r] diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.py b/erpnext/stock/doctype/delivery_note/delivery_note.py index c1bb92dd27..c109335b6f 100644 --- a/erpnext/stock/doctype/delivery_note/delivery_note.py +++ b/erpnext/stock/doctype/delivery_note/delivery_note.py @@ -117,7 +117,7 @@ class DocType(TransactionBase): if doc.fields.get('item_code'): arg = {'item_code':doc.fields.get('item_code'), 'income_account':doc.fields.get('income_account'), 'cost_center': doc.fields.get('cost_center'), 'warehouse': doc.fields.get('warehouse')}; - ret = obj.get_item_defaults(arg, self) + ret = obj.get_item_defaults(arg) for r in ret: if not doc.fields.get(r): doc.fields[r] = ret[r] From 901e92d8fae6443ba3f4d66c2061da35b6b5637e Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 15 May 2012 13:40:26 +0530 Subject: [PATCH 2/4] rejected qty issue fixed --- erpnext/stock/doctype/stock_ledger/stock_ledger.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/stock/doctype/stock_ledger/stock_ledger.py b/erpnext/stock/doctype/stock_ledger/stock_ledger.py index 9ee1f62754..bc4505b61e 100644 --- a/erpnext/stock/doctype/stock_ledger/stock_ledger.py +++ b/erpnext/stock/doctype/stock_ledger/stock_ledger.py @@ -97,7 +97,7 @@ class DocType: msgprint("Serial no is mandatory for item: "+ d.item_code, raise_exception = 1) # validate rejected serial nos - if fname == 'purchase_receipt_details' and d.rejected_qty and ar_required == 'Yes' and not d.rejected_serial_no: + if fname == 'purchase_receipt_details' and flt(d.rejected_qty) > 0 and ar_required == 'Yes' and not d.rejected_serial_no: msgprint("Rejected serial no is mandatory for rejected qty of item: "+ d.item_code, raise_exception = 1) From f044526b9272bd37ea7fa3fb1a12cdeb8e04903e Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 15 May 2012 15:29:47 +0530 Subject: [PATCH 3/4] json error fixed in stock entry --- erpnext/stock/doctype/stock_entry/stock_entry.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.py b/erpnext/stock/doctype/stock_entry/stock_entry.py index dee8790adc..e56ad03942 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.py +++ b/erpnext/stock/doctype/stock_entry/stock_entry.py @@ -49,7 +49,8 @@ class DocType(TransactionBase): # get item details # ---------------- def get_item_details(self, arg): - arg, actual_qty, in_rate = eval(arg), 0, 0 + import json + arg, actual_qty, in_rate = json.loads(arg), 0, 0 item = sql("select stock_uom, description, item_name from `tabItem` where name = %s and (ifnull(end_of_life,'')='' or end_of_life ='0000-00-00' or end_of_life > now())", (arg.get('item_code')), as_dict = 1) if not item: From a5a747fd8d857fd3a284051668038fe3b001937e Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Tue, 15 May 2012 18:17:52 +0530 Subject: [PATCH 4/4] reload sales invoice print formats --- .../patches/may_2012/reload_sales_invoice_pf.py | 16 ++++++++++++++++ erpnext/patches/patch_list.py | 5 +++++ 2 files changed, 21 insertions(+) create mode 100644 erpnext/patches/may_2012/reload_sales_invoice_pf.py diff --git a/erpnext/patches/may_2012/reload_sales_invoice_pf.py b/erpnext/patches/may_2012/reload_sales_invoice_pf.py new file mode 100644 index 0000000000..63acbedef1 --- /dev/null +++ b/erpnext/patches/may_2012/reload_sales_invoice_pf.py @@ -0,0 +1,16 @@ +def execute(): + import webnotes + import webnotes.modules + res = webnotes.conn.sql("""\ + select module, name, standard from `tabPrint Format` + where name like 'Sales Invoice%'""", as_dict=1) + for r in res: + if r.get('standard')=='Yes' and \ + r.get('name') in [ + 'Sales Invoice Classic', + 'Sales Invoice Spartan', + 'Sales Invoice Modern' + ]: + print r.get('name') + webnotes.modules.reload_doc(r.get('module'), 'Print Format', r.get('name')) + \ No newline at end of file diff --git a/erpnext/patches/patch_list.py b/erpnext/patches/patch_list.py index 6f2f8cefd5..5a82d425a2 100644 --- a/erpnext/patches/patch_list.py +++ b/erpnext/patches/patch_list.py @@ -347,5 +347,10 @@ patch_list = [ 'patch_file': 'page_role_series_fix', 'description': 'reset series of page role at max' }, + { + 'patch_module': 'patches.may_2012', + 'patch_file': 'reload_sales_invoice_pf', + 'description': 'Reload sales invoice print formats' + }, ]