fix: rate gets overwritten when pricing rule is set

This commit is contained in:
Saqib Ansari
2020-04-24 14:51:14 +05:30
parent 92b933f4ac
commit 40140c63dc
2 changed files with 3 additions and 2 deletions

View File

@@ -1407,12 +1407,12 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
for(var k in args) {
let data = args[k];
debugger;
if (data && data.apply_rule_on_other_items) {
me.frm.doc.items.forEach(d => {
if (in_list(data.apply_rule_on_other_items, d[data.apply_rule_on])) {
for(var k in data) {
if (in_list(fields, k) && data[k]) {
if (in_list(fields, k) && data[k] && (data.price_or_product_discount === 'price' || k === 'pricing_rules')) {
frappe.model.set_value(d.doctype, d.name, k, data[k]);
}
}