From 16d7b49d7323b7cb2f4a9d43ebb0b896d775f5d0 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 30 Jan 2019 17:27:08 +0530 Subject: [PATCH 1/4] fix: Default value for 'raw materials rate based on' in BOM --- erpnext/manufacturing/doctype/bom/bom.json | 3 ++- erpnext/manufacturing/doctype/bom/bom.py | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/erpnext/manufacturing/doctype/bom/bom.json b/erpnext/manufacturing/doctype/bom/bom.json index 0cf7dc4f81..79c883a734 100644 --- a/erpnext/manufacturing/doctype/bom/bom.json +++ b/erpnext/manufacturing/doctype/bom/bom.json @@ -642,6 +642,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "default": "Valuation Rate", "fieldname": "rm_cost_as_per", "fieldtype": "Select", "hidden": 0, @@ -1977,7 +1978,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2018-12-13 17:45:44.843197", + "modified": "2019-01-30 16:39:34.353721", "modified_by": "Administrator", "module": "Manufacturing", "name": "BOM", diff --git a/erpnext/manufacturing/doctype/bom/bom.py b/erpnext/manufacturing/doctype/bom/bom.py index 2317634cfc..ba3b7192a3 100644 --- a/erpnext/manufacturing/doctype/bom/bom.py +++ b/erpnext/manufacturing/doctype/bom/bom.py @@ -163,6 +163,8 @@ class BOM(WebsiteGenerator): def get_rm_rate(self, arg): """ Get raw material rate as per selected method, if bom exists takes bom cost """ rate = 0 + if not self.rm_cost_as_per: + self.rm_cost_as_per = "Valuation Rate" if arg.get('scrap_items'): rate = self.get_valuation_rate(arg) From 429996752de6f41262e8a0c88ab383523227b3de Mon Sep 17 00:00:00 2001 From: Saurabh Date: Wed, 30 Jan 2019 17:45:48 +0530 Subject: [PATCH 2/4] fix: patch fixes (#16524) --- erpnext/patches/v11_1/setup_guardian_role.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/erpnext/patches/v11_1/setup_guardian_role.py b/erpnext/patches/v11_1/setup_guardian_role.py index bb61f9818d..6ccfed9617 100644 --- a/erpnext/patches/v11_1/setup_guardian_role.py +++ b/erpnext/patches/v11_1/setup_guardian_role.py @@ -3,8 +3,10 @@ import frappe def execute(): if 'Education' in frappe.get_active_domains() and not frappe.db.exists("Role", "Guardian"): - frappe.new_doc({ - "doctype": "Role", + doc = frappe.new_doc("Role") + doc.update({ "role_name": "Guardian", "desk_access": 0 - }).insert(ignore_permissions=True) + }) + + doc.insert(ignore_permissions=True) From 245b73b94f08a0386288e044381016d4ba840270 Mon Sep 17 00:00:00 2001 From: Aditya Hase Date: Wed, 30 Jan 2019 19:56:04 +0530 Subject: [PATCH 3/4] fix(search): Fix possible reflected XSS attack vector (#16522) --- erpnext/templates/pages/product_search.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/templates/pages/product_search.html b/erpnext/templates/pages/product_search.html index d5a56b2cac..f9efd485d3 100644 --- a/erpnext/templates/pages/product_search.html +++ b/erpnext/templates/pages/product_search.html @@ -10,7 +10,7 @@