From f90f6739035472650fd304dad5fec2961ee70421 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 6 Sep 2011 15:25:19 +0530 Subject: [PATCH 01/10] validation logic changed in SO-RV mapper --- .../Sales Order-Receivable Voucher.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/accounts/DocType Mapper/Sales Order-Receivable Voucher/Sales Order-Receivable Voucher.txt b/accounts/DocType Mapper/Sales Order-Receivable Voucher/Sales Order-Receivable Voucher.txt index f1f77101b3..78431f574f 100644 --- a/accounts/DocType Mapper/Sales Order-Receivable Voucher/Sales Order-Receivable Voucher.txt +++ b/accounts/DocType Mapper/Sales Order-Receivable Voucher/Sales Order-Receivable Voucher.txt @@ -5,7 +5,7 @@ { 'creation': '2010-08-08 17:09:36', 'docstatus': 0, - 'modified': '2011-08-08 16:56:40', + 'modified': '2011-08-31 16:53:11', 'modified_by': 'Administrator', 'owner': 'Administrator' }, @@ -31,7 +31,7 @@ # These values are common for all DocType Mapper { - 'doctype': 'DocType Mapper', + 'doctype': u'DocType Mapper', 'from_doctype': 'Sales Order', 'module': 'Accounts', 'name': '__common__', @@ -41,7 +41,7 @@ # DocType Mapper, Sales Order-Receivable Voucher { - 'doctype': 'DocType Mapper', + 'doctype': u'DocType Mapper', 'name': 'Sales Order-Receivable Voucher' }, @@ -128,7 +128,7 @@ 'match_id': 1, 'to_field': 'entries', 'to_table': 'RV Detail', - 'validation_logic': 'amount > ifnull(billed_amt, 0) and docstatus = 1' + 'validation_logic': 'docstatus = 1' }, # Table Mapper Detail From 8c572e1fb10cb4582743ff4b912c9f6548f1583b Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 7 Sep 2011 11:41:22 +0530 Subject: [PATCH 02/10] corrected spelling mistake in patch --- patches/patch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patches/patch.py b/patches/patch.py index e815865e84..f550aa9b26 100644 --- a/patches/patch.py +++ b/patches/patch.py @@ -293,7 +293,7 @@ def execute(patch_no): elif patch_no == 353: reload_doc('hr', 'doctype', 'salary_manager') elif patch_no == 354: - reload_doc('setup', 'doctype','feature_setup') + reload_doc('setup', 'doctype','features_setup') reload_doc('stock','doctype','item') sql("update tabDocField set label='Produced Qty',description='Updated after finished goods are transferred to FG Warehouse through Stock Entry' where parent='Production Order' and fieldname='produced_qty'") rs = sql("select fieldname from tabDocField where parent='Features Setup' and fieldname is not null") From 69d15deb476a850556b8f1ed1b7c141f523b6cc2 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 7 Sep 2011 15:09:51 +0530 Subject: [PATCH 03/10] fixed sql syntax --- stock/doctype/delivery_note/delivery_note.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stock/doctype/delivery_note/delivery_note.py b/stock/doctype/delivery_note/delivery_note.py index e5acd163a7..00711978a8 100644 --- a/stock/doctype/delivery_note/delivery_note.py +++ b/stock/doctype/delivery_note/delivery_note.py @@ -444,7 +444,7 @@ class DocType(TransactionBase): def update_pack_nett_weight(self): for d in getlist(self.doclist, 'delivery_note_details'): if d.item_name: - item_wt = sql("select nett_weight from `tabItem` where item_name = '%s'" % (d.item_name)) + item_wt = sql("select nett_weight from `tabItem` where item_name = %s", (d.item_name)) d.pack_nett_wt = item_wt and flt(item_wt[0][0])*flt(d.qty) or 0 # ========================================== From 9e79aa814a0affb9ab881a201f564c4efabd6ad4 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 7 Sep 2011 15:12:05 +0530 Subject: [PATCH 04/10] default_print_format added in doctype --- patches/patch.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/patches/patch.py b/patches/patch.py index f550aa9b26..906e039b0f 100644 --- a/patches/patch.py +++ b/patches/patch.py @@ -1,7 +1,7 @@ # REMEMBER to update this # ======================== -last_patch = 355 +last_patch = 356 #------------------------------------------- @@ -305,4 +305,6 @@ def execute(patch_no): elif patch_no == 355: reload_doc('hr', 'doctype', 'salary_slip') delete_doc('DocType', 'Salary Control Panel') - + elif patch_no == 356: + reload_doc('doctype', 'core', 'doctype') + sql("update `tabDocType` set default_print_format = 'Standard'") From 936dcd8d988a969595d0403dc8d8f2d312e82b76 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 7 Sep 2011 15:34:57 +0530 Subject: [PATCH 05/10] delete redundant code fields from doctype --- patches/patch.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/patches/patch.py b/patches/patch.py index 906e039b0f..9d6e731a9c 100644 --- a/patches/patch.py +++ b/patches/patch.py @@ -1,7 +1,7 @@ # REMEMBER to update this # ======================== -last_patch = 356 +last_patch = 357 #------------------------------------------- @@ -308,3 +308,5 @@ def execute(patch_no): elif patch_no == 356: reload_doc('doctype', 'core', 'doctype') sql("update `tabDocType` set default_print_format = 'Standard'") + elif patch_no == 357: + sql("delete from `tabDocField` where (fieldname in ('client_string', 'server_code_error', 'server_code_compiled', 'server_code', 'server_code_core', 'client_script', 'client_script_core', 'dt_template', change_log) or label = 'Template') and parent = 'DocType'") From 93fa876c7cbd23c37e98db088371c83ce0cf3d01 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 7 Sep 2011 15:54:22 +0530 Subject: [PATCH 06/10] patch fixed --- patches/patch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patches/patch.py b/patches/patch.py index 9d6e731a9c..e4b38d0f62 100644 --- a/patches/patch.py +++ b/patches/patch.py @@ -307,6 +307,6 @@ def execute(patch_no): delete_doc('DocType', 'Salary Control Panel') elif patch_no == 356: reload_doc('doctype', 'core', 'doctype') - sql("update `tabDocType` set default_print_format = 'Standard'") + sql("update `tabDocType` set default_print_format = 'Standard' where name = 'Delivery Note'") elif patch_no == 357: sql("delete from `tabDocField` where (fieldname in ('client_string', 'server_code_error', 'server_code_compiled', 'server_code', 'server_code_core', 'client_script', 'client_script_core', 'dt_template', change_log) or label = 'Template') and parent = 'DocType'") From c6b506158b36aed51d479c1c45c419c54e9c4540 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 7 Sep 2011 16:06:42 +0530 Subject: [PATCH 07/10] fixed patch --- patches/patch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patches/patch.py b/patches/patch.py index e4b38d0f62..e5586f8bc8 100644 --- a/patches/patch.py +++ b/patches/patch.py @@ -306,7 +306,7 @@ def execute(patch_no): reload_doc('hr', 'doctype', 'salary_slip') delete_doc('DocType', 'Salary Control Panel') elif patch_no == 356: - reload_doc('doctype', 'core', 'doctype') + reload_doc('core', 'doctype', 'doctype') sql("update `tabDocType` set default_print_format = 'Standard' where name = 'Delivery Note'") elif patch_no == 357: sql("delete from `tabDocField` where (fieldname in ('client_string', 'server_code_error', 'server_code_compiled', 'server_code', 'server_code_core', 'client_script', 'client_script_core', 'dt_template', change_log) or label = 'Template') and parent = 'DocType'") From 1477f23b4c3e724a5a12fcab31eb8c8c01a2301e Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 7 Sep 2011 16:09:41 +0530 Subject: [PATCH 08/10] fixed patch --- patches/patch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patches/patch.py b/patches/patch.py index e5586f8bc8..6ca01714f7 100644 --- a/patches/patch.py +++ b/patches/patch.py @@ -309,4 +309,4 @@ def execute(patch_no): reload_doc('core', 'doctype', 'doctype') sql("update `tabDocType` set default_print_format = 'Standard' where name = 'Delivery Note'") elif patch_no == 357: - sql("delete from `tabDocField` where (fieldname in ('client_string', 'server_code_error', 'server_code_compiled', 'server_code', 'server_code_core', 'client_script', 'client_script_core', 'dt_template', change_log) or label = 'Template') and parent = 'DocType'") + sql("delete from `tabDocField` where (fieldname in ('client_string', 'server_code_error', 'server_code_compiled', 'server_code', 'server_code_core', 'client_script', 'client_script_core', 'dt_template', 'change_log') or label = 'Template') and parent = 'DocType'") From 20551b6551183d6fe5b2653be16c881c5e5fbe3c Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 7 Sep 2011 16:59:58 +0530 Subject: [PATCH 09/10] fixed patch --- patches/patch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patches/patch.py b/patches/patch.py index e4b38d0f62..21d8e2a532 100644 --- a/patches/patch.py +++ b/patches/patch.py @@ -309,4 +309,4 @@ def execute(patch_no): reload_doc('doctype', 'core', 'doctype') sql("update `tabDocType` set default_print_format = 'Standard' where name = 'Delivery Note'") elif patch_no == 357: - sql("delete from `tabDocField` where (fieldname in ('client_string', 'server_code_error', 'server_code_compiled', 'server_code', 'server_code_core', 'client_script', 'client_script_core', 'dt_template', change_log) or label = 'Template') and parent = 'DocType'") + sql("delete from `tabDocField` where (fieldname in ('client_string', 'server_code_error', 'server_code_compiled', 'server_code', 'server_code_core', 'client_script', 'client_script_core', 'dt_template', 'change_log') or label = 'Template') and parent = 'DocType'") From 11e895713e56a82c4d21c5cb9f89a633f60a7659 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 7 Sep 2011 17:06:03 +0530 Subject: [PATCH 10/10] escape sequence in dn query --- stock/doctype/delivery_note/delivery_note.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stock/doctype/delivery_note/delivery_note.py b/stock/doctype/delivery_note/delivery_note.py index 00711978a8..6d48914429 100644 --- a/stock/doctype/delivery_note/delivery_note.py +++ b/stock/doctype/delivery_note/delivery_note.py @@ -443,8 +443,8 @@ class DocType(TransactionBase): # ========================================== def update_pack_nett_weight(self): for d in getlist(self.doclist, 'delivery_note_details'): - if d.item_name: - item_wt = sql("select nett_weight from `tabItem` where item_name = %s", (d.item_name)) + if d.item_code: + item_wt = sql("select nett_weight from `tabItem` where name = %s", (d.item_code)) d.pack_nett_wt = item_wt and flt(item_wt[0][0])*flt(d.qty) or 0 # ==========================================