From b1abf2d955e782a19e9645eb396f68ad39d8e053 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Wed, 27 Mar 2024 13:29:22 +0530 Subject: [PATCH] fix: rate changed on changing of the qty --- erpnext/public/js/controllers/transaction.js | 21 ++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js index 0e767946bd..c03e8b9bcb 100644 --- a/erpnext/public/js/controllers/transaction.js +++ b/erpnext/public/js/controllers/transaction.js @@ -1298,19 +1298,20 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe this.frm.fields_dict.items.grid.toggle_enable("conversion_factor", ((item.uom != item.stock_uom) && !frappe.meta.get_docfield(cur_frm.fields_dict.items.grid.doctype, "conversion_factor").read_only)? true: false); } - } qty(doc, cdt, cdn) { - let item = frappe.get_doc(cdt, cdn); - // item.pricing_rules = '' - frappe.run_serially([ - () => this.remove_pricing_rule_for_item(item), - () => this.conversion_factor(doc, cdt, cdn, true), - () => this.apply_price_list(item, true), //reapply price list before applying pricing rule - () => this.calculate_stock_uom_rate(doc, cdt, cdn), - () => this.apply_pricing_rule(item, true) - ]); + if (!this.frm.doc.__onload?.load_after_mapping) { + let item = frappe.get_doc(cdt, cdn); + // item.pricing_rules = '' + frappe.run_serially([ + () => this.remove_pricing_rule_for_item(item), + () => this.conversion_factor(doc, cdt, cdn, true), + () => this.apply_price_list(item, true), //reapply price list before applying pricing rule + () => this.calculate_stock_uom_rate(doc, cdt, cdn), + () => this.apply_pricing_rule(item, true) + ]); + } } stock_qty(doc, cdt, cdn) { -- GitLab