From e78a87720201c3e9553577210c02a686181ba952 Mon Sep 17 00:00:00 2001 From: Saurabh Date: Tue, 17 Jul 2018 16:38:11 +0530 Subject: [PATCH] patch fixes (#14936) --- .../purchase_invoice/purchase_invoice.json | 2 +- .../purchase_order/purchase_order.json | 2 +- .../supplier_quotation.json | 2 +- .../v11_0/set_department_for_doctypes.py | 27 ++++++++++++------- .../selling/doctype/quotation/quotation.json | 2 +- .../doctype/delivery_note/delivery_note.json | 2 +- .../purchase_receipt/purchase_receipt.json | 2 +- 7 files changed, 23 insertions(+), 16 deletions(-) diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json index 0d40b2188d..4db56f396f 100755 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json @@ -4493,7 +4493,7 @@ "istable": 0, "max_attachments": 0, "menu_index": 0, - "modified": "2018-07-06 02:38:40.310899", + "modified": "2018-07-17 02:38:40.310899", "modified_by": "Administrator", "module": "Accounts", "name": "Purchase Invoice", diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.json b/erpnext/buying/doctype/purchase_order/purchase_order.json index 9f39cbfe80..c6fb2a1981 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.json +++ b/erpnext/buying/doctype/purchase_order/purchase_order.json @@ -3737,7 +3737,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2018-07-06 11:00:05.037716", + "modified": "2018-07-17 11:00:05.037716", "modified_by": "Administrator", "module": "Buying", "name": "Purchase Order", diff --git a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json index b7e1e332d6..8f7bb2bcbc 100644 --- a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json +++ b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json @@ -2779,7 +2779,7 @@ "istable": 0, "max_attachments": 0, "menu_index": 0, - "modified": "2018-07-06 02:45:48.616334", + "modified": "2018-07-17 02:45:48.616334", "modified_by": "Administrator", "module": "Buying", "name": "Supplier Quotation", diff --git a/erpnext/patches/v11_0/set_department_for_doctypes.py b/erpnext/patches/v11_0/set_department_for_doctypes.py index 274190833e..b1098abb57 100644 --- a/erpnext/patches/v11_0/set_department_for_doctypes.py +++ b/erpnext/patches/v11_0/set_department_for_doctypes.py @@ -3,14 +3,21 @@ import frappe # Set department value based on employee value def execute(): - doctypes_to_update = ['Appraisal', 'Leave Allocation', 'Expense Claim', 'Instructor', 'Salary Slip', - 'Attendance', 'Training Feedback', 'Training Result Employee', - 'Leave Application', 'Employee Advance', 'Activity Cost', 'Training Event Employee', - 'Timesheet', 'Sales Person', 'Payroll Employee Detail'] - for doctype in doctypes_to_update: - if frappe.db.table_exists(doctype): - frappe.db.sql(""" - update `tab%s` dt - set department=(select department from `tabEmployee` where name=dt.employee) - """ % doctype) \ No newline at end of file + doctypes_to_update = { + 'hr': ['Appraisal', 'Leave Allocation', 'Expense Claim', 'Salary Slip', + 'Attendance', 'Training Feedback', 'Training Result Employee','Leave Application', + 'Employee Advance', 'Training Event Employee', 'Payroll Employee Detail'], + 'education': ['Instructor'], + 'projects': ['Activity Cost', 'Timesheet'], + 'setup': ['Sales Person'] + } + + for module, doctypes in doctypes_to_update.items(): + for doctype in doctypes: + if frappe.db.table_exists(doctype): + frappe.reload_doc(module, 'doctype', frappe.scrub(doctype)) + frappe.db.sql(""" + update `tab%s` dt + set department=(select department from `tabEmployee` where name=dt.employee) + """ % doctype) diff --git a/erpnext/selling/doctype/quotation/quotation.json b/erpnext/selling/doctype/quotation/quotation.json index ccbb942d40..d3ca4f8f2f 100644 --- a/erpnext/selling/doctype/quotation/quotation.json +++ b/erpnext/selling/doctype/quotation/quotation.json @@ -3163,7 +3163,7 @@ "istable": 0, "max_attachments": 1, "menu_index": 0, - "modified": "2018-07-06 03:23:15.354674", + "modified": "2018-07-17 03:23:15.354674", "modified_by": "Administrator", "module": "Selling", "name": "Quotation", diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.json b/erpnext/stock/doctype/delivery_note/delivery_note.json index ffcda03ec0..5572baf645 100644 --- a/erpnext/stock/doctype/delivery_note/delivery_note.json +++ b/erpnext/stock/doctype/delivery_note/delivery_note.json @@ -3881,7 +3881,7 @@ "istable": 0, "max_attachments": 0, "menu_index": 0, - "modified": "2018-07-06 03:03:35.035396", + "modified": "2018-07-17 03:03:35.035396", "modified_by": "Administrator", "module": "Stock", "name": "Delivery Note", diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json index 1f47317b2a..51ccfcdb4f 100755 --- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json +++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json @@ -3436,7 +3436,7 @@ "istable": 0, "max_attachments": 0, "menu_index": 0, - "modified": "2018-07-06 02:59:59.609643", + "modified": "2018-07-17 02:59:59.609643", "modified_by": "Administrator", "module": "Stock", "name": "Purchase Receipt",