From 52a99d8da684cdddfa01c7cb15824e5783cc5645 Mon Sep 17 00:00:00 2001 From: Frappe PR Bot Date: Mon, 13 Sep 2021 18:48:05 +0530 Subject: [PATCH] fix: editable price list rate field in sales transactions (#27455) (#27461) (cherry picked from commit a5baf909b7b9defd046b23e11d2c0c3a32737e2c) Co-authored-by: Saqib --- erpnext/selling/sales_common.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/erpnext/selling/sales_common.js b/erpnext/selling/sales_common.js index 091c22271e6..a068430c6c1 100644 --- a/erpnext/selling/sales_common.js +++ b/erpnext/selling/sales_common.js @@ -243,7 +243,12 @@ erpnext.selling.SellingController = erpnext.TransactionController.extend({ var editable_price_list_rate = cint(frappe.defaults.get_default("editable_price_list_rate")); if(df && editable_price_list_rate) { - df.read_only = 0; + const parent_field = frappe.meta.get_parentfield(this.frm.doc.doctype, this.frm.doc.doctype + " Item"); + if (!this.frm.fields_dict[parent_field]) return; + + this.frm.fields_dict[parent_field].grid.update_docfield_property( + 'price_list_rate', 'read_only', 0 + ); } },