fix: editable price list rate field in sales transactions (#27455)

This commit is contained in:
Saqib 2021-09-13 15:50:20 +05:30 committed by GitHub
parent bab644a249
commit a5baf909b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -247,7 +247,12 @@ erpnext.selling.SellingController = class SellingController extends erpnext.Tran
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
);
}
}