From 5475a3ca66a2e301f408f97338298923b84082aa Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Mon, 2 Apr 2012 14:06:46 +0530 Subject: [PATCH] patch fixes --- .../Delivery Note-Sales Invoice.txt | 4 +- .../Sales Order-Sales Invoice.txt | 4 +- erpnext/patches/jan_mar_2012/label_cleanup.py | 10 ----- .../patches/jan_mar_2012/pending_patches.py | 10 +---- erpnext/patches/jan_mar_2012/reload_mapper.py | 2 +- erpnext/patches/jan_mar_2012/reload_quote.py | 2 +- erpnext/patches/jan_mar_2012/reload_table.py | 10 +---- erpnext/patches/jan_mar_2012/rename_dt.py | 2 +- .../jan_mar_2012/stock_entry_others_patch.py | 2 +- .../jan_mar_2012/update_se_fld_options.py | 2 +- erpnext/patches/mar_2012/pos_invoice_fix.py | 4 +- erpnext/patches/patch_list.py | 1 + .../Purchase Order-Purchase Receipt.txt | 28 ++++++++++++- .../Sales Order-Delivery Note.txt | 40 +++++++++++++++++-- 14 files changed, 76 insertions(+), 45 deletions(-) diff --git a/erpnext/accounts/DocType Mapper/Delivery Note-Sales Invoice/Delivery Note-Sales Invoice.txt b/erpnext/accounts/DocType Mapper/Delivery Note-Sales Invoice/Delivery Note-Sales Invoice.txt index 15369e4c6d..66572be442 100644 --- a/erpnext/accounts/DocType Mapper/Delivery Note-Sales Invoice/Delivery Note-Sales Invoice.txt +++ b/erpnext/accounts/DocType Mapper/Delivery Note-Sales Invoice/Delivery Note-Sales Invoice.txt @@ -3,9 +3,9 @@ # These values are common in all dictionaries { - 'creation': '2010-09-20 12:33:33', + 'creation': '2012-04-02 13:38:02', 'docstatus': 0, - 'modified': '2012-03-30 14:50:43', + 'modified': '2012-04-02 13:38:02', 'modified_by': u'Administrator', 'owner': u'Administrator' }, diff --git a/erpnext/accounts/DocType Mapper/Sales Order-Sales Invoice/Sales Order-Sales Invoice.txt b/erpnext/accounts/DocType Mapper/Sales Order-Sales Invoice/Sales Order-Sales Invoice.txt index efa129122e..66de9491ae 100644 --- a/erpnext/accounts/DocType Mapper/Sales Order-Sales Invoice/Sales Order-Sales Invoice.txt +++ b/erpnext/accounts/DocType Mapper/Sales Order-Sales Invoice/Sales Order-Sales Invoice.txt @@ -3,9 +3,9 @@ # These values are common in all dictionaries { - 'creation': '2010-09-20 12:33:35', + 'creation': '2012-04-02 13:38:02', 'docstatus': 0, - 'modified': '2012-03-30 13:33:31', + 'modified': '2012-04-02 13:38:02', 'modified_by': u'Administrator', 'owner': u'Administrator' }, diff --git a/erpnext/patches/jan_mar_2012/label_cleanup.py b/erpnext/patches/jan_mar_2012/label_cleanup.py index 9e4d4a9dae..642140b6d1 100644 --- a/erpnext/patches/jan_mar_2012/label_cleanup.py +++ b/erpnext/patches/jan_mar_2012/label_cleanup.py @@ -3,16 +3,6 @@ def execute(): from webnotes.model import delete_doc from webnotes.modules import reload_doc - dt = { - 'selling': ['quotation', 'sales_order', 'quotation_detail', 'sales_order_detail'], - 'stock': ['delivery_note', 'delivery_note_detail', 'purchase_receipt', 'purchase_receipt_detail'], - 'accounts': ['receivable_voucher', 'payable_voucher', 'rv_detail', 'pv_detail', 'rv_tax_detail', 'purchase_tax_detail'], - 'buying': ['purchase_order', 'po_detail'] - } - for m in dt: - for d in dt[m]: - reload_doc(m, 'doctype', d) - webnotes.conn.sql("""delete from `tabDocField` where label in ('Note1', 'OT Notes', 'Note', 'Note HTML', 'Rates HTML') diff --git a/erpnext/patches/jan_mar_2012/pending_patches.py b/erpnext/patches/jan_mar_2012/pending_patches.py index 0cc73f3042..c21030a6c1 100644 --- a/erpnext/patches/jan_mar_2012/pending_patches.py +++ b/erpnext/patches/jan_mar_2012/pending_patches.py @@ -21,7 +21,6 @@ def execute(): sql = webnotes.conn.sql reload_doc('hr', 'doctype', 'appraisal') - reload_doc('hr', 'doctype', 'appraisal_detail') sql("update `tabDocField` set `hidden` = 0 where fieldname = 'group_or_ledger' and parent = 'Cost Center'") sql("update tabDocPerm set amend = 0 where parent = 'Salary Structure'") @@ -31,12 +30,7 @@ def execute(): sql("delete from `tabDocField` where label = 'View Ledger Entry' and parent = 'Journal Voucher' and fieldtype = 'Button' limit 1") if sql("select count(name) from `tabDocField` where label = 'Get Balance' and parent = 'Journal Voucher' and fieldtype = 'Button'")[0][0] > 1: sql("delete from `tabDocField` where label = 'Get Balance' and parent = 'Journal Voucher' and fieldtype = 'Button' limit 1") - - reload_doc('accounts', 'doctype', 'internal_reconciliation') - reload_doc('accounts', 'doctype', 'ir_payment_detail') - reload_doc('accounts', 'Module Def', 'Accounts') - - + if sql("select count(name) from `tabDocField` where label = 'Get Specification Details' and parent = 'Quality Inspection' and fieldtype = 'Button'")[0][0] > 1: sql("delete from `tabDocField` where label = 'Get Specification Details' and parent = 'Quality Inspection' and fieldtype = 'Button' limit 1") @@ -44,8 +38,6 @@ def execute(): reload_doc('stock', 'DocType Mapper', 'Purchase Order-Purchase Receipt') reload_doc('accounts', 'doctype', 'cost_center') - reload_doc('stock', 'Module Def', 'Stock') - sql("delete from `tabModule Def Item` where display_name = 'Serial No' and parent = 'Support'") sql("update `tabDocType` set subject = 'Item Code: %(item_code)s, Warehouse: %(warehouse)s' where name = 'Serial No'") # Patch for adding packing related columns (packed by, checked by, shipping mark etc) diff --git a/erpnext/patches/jan_mar_2012/reload_mapper.py b/erpnext/patches/jan_mar_2012/reload_mapper.py index f3a469f1b5..987d4a7732 100644 --- a/erpnext/patches/jan_mar_2012/reload_mapper.py +++ b/erpnext/patches/jan_mar_2012/reload_mapper.py @@ -1,6 +1,6 @@ def execute(): import webnotes - from webnotes.modules.module_manager import reload_doc + from webnotes.modules import reload_doc reload_doc('stock', 'DocType Mapper', 'Sales Order-Delivery Note') reload_doc('accounts', 'DocType Mapper', 'Sales Order-Sales Invoice') diff --git a/erpnext/patches/jan_mar_2012/reload_quote.py b/erpnext/patches/jan_mar_2012/reload_quote.py index 5715bb4efb..8df293f7a4 100644 --- a/erpnext/patches/jan_mar_2012/reload_quote.py +++ b/erpnext/patches/jan_mar_2012/reload_quote.py @@ -1,4 +1,4 @@ def execute(): import webnotes - from webnotes.modules.module_manager import reload_doc + from webnotes.modules import reload_doc reload_doc('selling', 'doctype', 'quotation') diff --git a/erpnext/patches/jan_mar_2012/reload_table.py b/erpnext/patches/jan_mar_2012/reload_table.py index 28a597bc61..53583204b5 100644 --- a/erpnext/patches/jan_mar_2012/reload_table.py +++ b/erpnext/patches/jan_mar_2012/reload_table.py @@ -1,11 +1,3 @@ def execute(): - import webnotes - from webnotes.modules import reload_doc - reload_doc('selling', 'doctype', 'quotation_detail') - reload_doc('selling', 'doctype', 'sales_order_detail') - reload_doc('stock', 'doctype', 'delivery_note_detail') - reload_doc('stock', 'doctype', 'purchase_receipt_detail') - reload_doc('buying', 'doctype', 'po_detail') - reload_doc('accounts', 'doctype', 'rv_detail') - reload_doc('accounts', 'doctype', 'pv_detail') + pass diff --git a/erpnext/patches/jan_mar_2012/rename_dt.py b/erpnext/patches/jan_mar_2012/rename_dt.py index e2cd2f0f6e..06bba6cc9d 100644 --- a/erpnext/patches/jan_mar_2012/rename_dt.py +++ b/erpnext/patches/jan_mar_2012/rename_dt.py @@ -3,7 +3,7 @@ from webnotes.model import rename, delete_doc from webnotes.model.code import get_obj from wnf import replace_code from termcolor import colored -from webnotes.modules.module_manager import reload_doc +from webnotes.modules import reload_doc from webnotes.utils import make_esc import os diff --git a/erpnext/patches/jan_mar_2012/stock_entry_others_patch.py b/erpnext/patches/jan_mar_2012/stock_entry_others_patch.py index 3a9441964c..7562fcaf44 100644 --- a/erpnext/patches/jan_mar_2012/stock_entry_others_patch.py +++ b/erpnext/patches/jan_mar_2012/stock_entry_others_patch.py @@ -1,6 +1,6 @@ def execute(): import webnotes - from webnotes.modules.module_manager import reload_doc + from webnotes.modules import reload_doc reload_doc('stock', 'doctype', 'stock_entry') webnotes.conn.sql("update `tabDocField` set options = concat(options, '\nOthers') where fieldname = 'purpose' and parent = 'Stock Entry'") 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 95bb528829..0428fc9934 100644 --- a/erpnext/patches/jan_mar_2012/update_se_fld_options.py +++ b/erpnext/patches/jan_mar_2012/update_se_fld_options.py @@ -2,5 +2,5 @@ def execute(): import webnotes webnotes.conn.sql("update `tabDocField` set options = 'BOM' where fieldname = 'bom_no' and parent = 'Stock Entry'") - from webnotes.modules.module_manager import reload_doc + from webnotes.modules import reload_doc reload_doc('stock', 'doctype', 'stock_entry') diff --git a/erpnext/patches/mar_2012/pos_invoice_fix.py b/erpnext/patches/mar_2012/pos_invoice_fix.py index 77ebcb4e4c..9848eb8609 100644 --- a/erpnext/patches/mar_2012/pos_invoice_fix.py +++ b/erpnext/patches/mar_2012/pos_invoice_fix.py @@ -1,5 +1,3 @@ def execute(): - import webnotes - webnotes.conn.sql("DELETE FROM `tabDocFormat` WHERE format='POS Invoice'") - from webnotes.modules.module_manager import reload_doc + from webnotes.modules import reload_doc reload_doc('accounts', 'Print Format', 'POS Invoice') diff --git a/erpnext/patches/patch_list.py b/erpnext/patches/patch_list.py index a4a0ac726d..4caf82e15c 100644 --- a/erpnext/patches/patch_list.py +++ b/erpnext/patches/patch_list.py @@ -232,6 +232,7 @@ patch_list = [ 'patch_file': 'delete_docformat', 'description': 'Deletes DocFormat from database' }, + { 'patch_module': 'patches.jan_mar_2012', 'patch_file': 'reload_mapper', 'description': 'SO-DN, SO-Rv, DN-RV' diff --git a/erpnext/stock/DocType Mapper/Purchase Order-Purchase Receipt/Purchase Order-Purchase Receipt.txt b/erpnext/stock/DocType Mapper/Purchase Order-Purchase Receipt/Purchase Order-Purchase Receipt.txt index 0a27e19dac..b7e6cd4624 100644 --- a/erpnext/stock/DocType Mapper/Purchase Order-Purchase Receipt/Purchase Order-Purchase Receipt.txt +++ b/erpnext/stock/DocType Mapper/Purchase Order-Purchase Receipt/Purchase Order-Purchase Receipt.txt @@ -3,9 +3,9 @@ # These values are common in all dictionaries { - 'creation': '2010-09-20 12:33:34', + 'creation': '2010-08-08 17:09:35', 'docstatus': 0, - 'modified': '2012-03-27 14:17:40', + 'modified': '2012-04-02 14:03:39', 'modified_by': u'Administrator', 'owner': u'Administrator' }, @@ -185,6 +185,19 @@ 'to_field': u'conversion_rate' }, + # Table Mapper Detail + { + 'doctype': u'Table Mapper Detail', + 'from_field': u'po_details', + 'from_table': u'PO Detail', + 'match_id': 1, + 'reference_doctype_key': u'prevdoc_doctype', + 'reference_key': u'prevdoc_detail_docname', + 'to_field': u'purchase_receipt_details', + 'to_table': u'Purchase Receipt Detail', + 'validation_logic': u'docstatus=1 and qty > ifnull(received_qty,0)' + }, + # Table Mapper Detail { 'doctype': u'Table Mapper Detail', @@ -208,6 +221,17 @@ 'validation_logic': u'docstatus = 1' }, + # Table Mapper Detail + { + 'doctype': u'Table Mapper Detail', + 'from_field': u'purchase_tax_details', + 'from_table': u'Purchase Tax Detail', + 'match_id': 2, + 'to_field': u'purchase_tax_details', + 'to_table': u'Purchase Tax Detail', + 'validation_logic': u'docstatus = 1' + }, + # Table Mapper Detail { 'doctype': u'Table Mapper Detail', diff --git a/erpnext/stock/DocType Mapper/Sales Order-Delivery Note/Sales Order-Delivery Note.txt b/erpnext/stock/DocType Mapper/Sales Order-Delivery Note/Sales Order-Delivery Note.txt index 651131e8fb..aeb5ec2e59 100644 --- a/erpnext/stock/DocType Mapper/Sales Order-Delivery Note/Sales Order-Delivery Note.txt +++ b/erpnext/stock/DocType Mapper/Sales Order-Delivery Note/Sales Order-Delivery Note.txt @@ -3,9 +3,9 @@ # These values are common in all dictionaries { - 'creation': '2010-09-20 12:33:35', + 'creation': '2010-08-08 17:09:35', 'docstatus': 0, - 'modified': '2012-03-27 14:17:39', + 'modified': '2012-04-02 13:37:14', 'modified_by': u'Administrator', 'owner': u'Administrator' }, @@ -137,6 +137,16 @@ 'to_field': u'export_rate' }, + # Field Mapper Detail + { + 'checking_operator': u'=', + 'doctype': u'Field Mapper Detail', + 'from_field': u'basic_rate', + 'map': u'Yes', + 'match_id': 1, + 'to_field': u'basic_rate' + }, + # Field Mapper Detail { 'doctype': u'Field Mapper Detail', @@ -231,6 +241,17 @@ 'validation_logic': u'name is not null' }, + # Table Mapper Detail + { + 'doctype': u'Table Mapper Detail', + 'from_field': u'other_charges', + 'from_table': u'RV Tax Detail', + 'match_id': 2, + 'to_field': u'other_charges', + 'to_table': u'RV Tax Detail', + 'validation_logic': u'name is not null' + }, + # Table Mapper Detail { 'doctype': u'Table Mapper Detail', @@ -242,6 +263,19 @@ 'validation_logic': u'name is not null' }, + # Table Mapper Detail + { + 'doctype': u'Table Mapper Detail', + 'from_field': u'sales_order_details', + 'from_table': u'Sales Order Detail', + 'match_id': 1, + 'reference_doctype_key': u'prevdoc_doctype', + 'reference_key': u'prevdoc_detail_docname', + 'to_field': u'delivery_note_details', + 'to_table': u'Delivery Note Detail', + 'validation_logic': u'qty > ifnull(delivered_qty,0) and docstatus = 1' + }, + # Table Mapper Detail { 'doctype': u'Table Mapper Detail', @@ -264,4 +298,4 @@ 'to_table': u'Delivery Note', 'validation_logic': u'docstatus = 1' } -] +] \ No newline at end of file