Merge branch 'shf_rename' of github.com:webnotes/erpnext into shf_rename
diff --git a/erpnext/patches/may_2012/renamedt_in_custom_search_criteria.py b/erpnext/patches/may_2012/renamedt_in_custom_search_criteria.py
new file mode 100644
index 0000000..3ac1f8e
--- /dev/null
+++ b/erpnext/patches/may_2012/renamedt_in_custom_search_criteria.py
@@ -0,0 +1,99 @@
+def execute():
+ import webnotes
+ rendt = {
+ 'Receivable Voucher' : 'Sales Invoice',
+ 'RV Detail' : 'Sales Invoice Item',
+ 'RV Tax Detail' : 'Sales Taxes and Charges',
+ 'Payable Voucher' : 'Purchase Invoice',
+ 'PV Detail' : 'Purchase Invoice Item',
+ 'Purchase Tax Detail' : 'Purchase Taxes and Charges',
+ 'Indent' : 'Purchase Request',
+ 'Indent Detail' : 'Purchase Request Item',
+ 'QA Inspection Report' : 'Quality Inspection',
+ 'Ticket' : 'Task',
+ 'Manage Account' : 'Global Defaults',
+ 'ToDo Item' : 'ToDo',
+ 'Term' : 'Terms and Conditions',
+ 'Static Parameter Detail' : 'SMS Parameter',
+ 'SS Earning Detail' : 'Salary Slip Earning',
+ 'SS Deduction Detail' : 'Salary Slip Deduction',
+ 'Sales Order Detail' : 'Sales Order Item',
+ 'Sales BOM Detail' : 'Sales BOM Item',
+ 'Return Detail' : 'Sales and Purchase Return Item',
+ 'Ref Rate Detail' : 'Item Price',
+ 'Receiver Detail' : 'SMS Receiver',
+ 'Quotation Detail' : 'Quotation Item',
+ 'QA Specification Detail' : 'Quality Inspection Reading',
+ 'Purchase Receipt Detail' : 'Purchase Receipt Item',
+ 'Purchase Other Charges' : 'Purchase Taxes and Charges Master',
+ 'PR Raw Material Detail' : 'Purchase Receipt Item Supplied',
+ 'PP SO Detail' : 'Production Plan Sales Order',
+ 'PP Detail' : 'Production Plan Item',
+ 'PO Raw Material Detail' : 'Purchase Order Item Supplied',
+ 'PO Detail' : 'Purchase Order Item',
+ 'Packing Slip Detail' : 'Packing Slip Item',
+ 'Other Charges' : 'Sales Taxes and Charges Master',
+ 'Order Lost Reason' : 'Quotation Lost Reason',
+ 'Manage Account' : 'Global Defaults',
+ 'Maintenance Visit Detail' : 'Maintenance Visit Purpose',
+ 'Ledger Balance Export' : 'Multi Ledger Report',
+ 'LC PR Detail' : 'Landed Cost Purchase Receipt',
+ 'Landed Cost Detail' : 'Landed Cost Item',
+ 'KRA Template' : 'Appraisal Template',
+ 'KRA Sheet' : 'Appraisal Template Goal',
+ 'Item Specification Detail' : 'Item Quality Inspection Parameter',
+ 'Item Maintenance Detail' : 'Maintenance Schedule Item',
+ 'IR Payment Detail' : 'Payment to Invoice Matching Tool Detail',
+ 'Internal Reconciliation' : 'Payment to Invoice Matching Tool',
+ 'Installed Item Details' : 'Installation Note Item',
+ 'Holiday List Detail' : 'Holiday',
+ 'Follow up' : 'Communication Log',
+ 'Flat BOM Detail' : 'BOM Explosion Item',
+ 'Expense Voucher Detail' : 'Expense Claim Detail',
+ 'Expense Voucher' : 'Expense Claim',
+ 'Expense Type' : 'Expense Claim Type',
+ 'Enquiry Detail' : 'Opportunity Item',
+ 'Enquiry' : 'Opportunity',
+ 'Earning Detail' : 'Salary Structure Earning',
+ 'DocLayerField' : 'Customize Form Field',
+ 'DocLayer' : 'Customize Form',
+ 'Delivery Note Detail' : 'Delivery Note Item',
+ 'Deduction Detail' : 'Salary Structure Deduction',
+ 'Comment Widget Record' : 'Comment',
+ 'BOM Material' : 'BOM Item',
+ 'Bill Of Materials' : 'BOM',
+ 'Appraisal Detail' : 'Appraisal Goal',
+ 'Advance Allocation Detail' : 'Purchase Invoice Advance',
+ 'Advance Adjustment Detail' : 'Sales Invoice Advance',
+ 'Ledger Detail' : 'Multi Ledger Report Detail',
+ 'TA Control' : 'Trend Analyzer Control',
+ 'Sales and Purchase Return Wizard' : 'Sales and Purchase Return Tool',
+ 'Educational Qualifications Detail' : 'Employee Education',
+ 'Delivery Note Packing Detail' : 'Delivery Note Packing Item',
+ 'Experience In Company Detail' : 'Employee Internal Work History',
+ 'Professional Training Details' : 'Employee Training',
+ 'Previous Experience Detail' : 'Employee External Work History',
+ }
+
+ for d in rendt:
+ webnotes.conn.sql("""
+ update
+ `tabSearch Criteria`
+ set
+ doc_type = replace(doc_type, %s, %s),
+ filters = replace(filters, %s, %s),
+ columns = replace(columns, %s, %s),
+ parent_doc_type = replace(parent_doc_type, %s, %s),
+ add_cond = replace(add_cond, %s, %s),
+ add_col = replace(add_col, %s, %s),
+ add_tab = replace(add_tab, %s, %s),
+ dis_filters = replace(dis_filters, %s, %s),
+ group_by = replace(group_by, %s, %s),
+ sort_by = replace(sort_by, %s, %s),
+ report_script = replace(report_script, %s, %s),
+ server_script = replace(server_script, %s, %s),
+ custom_query = replace(custom_query, %s, %s)
+ """, (d, rendt[d], d, rendt[d], d, rendt[d], d, rendt[d], d, rendt[d], d, rendt[d], d, rendt[d],
+ d, rendt[d], d, rendt[d], d, rendt[d], d, rendt[d], d, rendt[d], d, rendt[d]))
+
+
diff --git a/erpnext/patches/patch_list.py b/erpnext/patches/patch_list.py
index d6d689f..01f4a0e 100644
--- a/erpnext/patches/patch_list.py
+++ b/erpnext/patches/patch_list.py
@@ -327,5 +327,10 @@
'patch_file': 'cleanup_notification_control',
'description': 'cleanup notification control'
},
+ {
+ 'patch_module': 'patches.may_2012',
+ 'patch_file': 'renamedt_in_custom_search_criteria',
+ 'description': 'raname dt in custom search criteria'
+ },
]
diff --git a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py
index e82a0d9..ee81518 100644
--- a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py
+++ b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py
@@ -51,16 +51,16 @@
"""Convert csv data into list"""
count = 2
for s in data:
- if s[0].strip() != 'Item Code': # remove the labels
- # validate
- if (submit and len(s) != 4) or (not submit and len(s) != 6):
- msgprint("Data entered at Row No " + cstr(count) + " in Attachment File is not in correct format.", raise_exception=1)
- self.validated = 0
- self.validate_item(s[0], count)
- self.validate_warehouse(s[1], count)
+ if count == 2: continue
+ # validate
+ if (submit and len(s) != 4) or (not submit and len(s) != 6):
+ msgprint("Data entered at Row No " + cstr(count) + " in Attachment File is not in correct format.", raise_exception=1)
+ self.validated = 0
+ self.validate_item(s[0], count)
+ self.validate_warehouse(s[1], count)
- self.data.append(s)
- count += 1
+ self.data.append(s)
+ count += 1
if not self.validated:
raise Exception
@@ -175,7 +175,7 @@
"""Add diffs column in attached file"""
# add header
- out = "'Item Code', 'Warehouse', 'Qty', 'Valuation Rate', 'Qty Diff', 'Val Rate Diff'"
+ out = "Item Code, Warehouse, Qty, Valuation Rate, Qty Diff, Val Rate Diff"
# add data
for d in self.data: