Merge pull request #30728 from deepeshgarg007/pricing_rule_apply_mapped_doc

fix: Price changing on creating Sales return from Delivery Note
This commit is contained in:
Deepesh Garg 2022-04-18 14:34:28 +05:30 committed by GitHub
commit 264ec65255
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1388,6 +1388,11 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe
return;
}
// Target doc created from a mapped doc
if (this.frm.doc.__onload && this.frm.doc.__onload.ignore_price_list) {
return;
}
return this.frm.call({
method: "erpnext.accounts.doctype.pricing_rule.pricing_rule.apply_pricing_rule",
args: { args: args, doc: me.frm.doc },
@ -1504,7 +1509,7 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe
me.remove_pricing_rule(frappe.get_doc(d.doctype, d.name));
}
if (d.free_item_data) {
if (d.free_item_data.length > 0) {
me.apply_product_discount(d);
}