Merge pull request #40019 from frappe/mergify/bp/version-15-hotfix/pr-39999
fix: TypeError for item pricing rules (backport #39999)
This commit is contained in:
commit
43c218c673
@ -1509,31 +1509,33 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe
|
|||||||
}
|
}
|
||||||
|
|
||||||
remove_pricing_rule_for_item(item) {
|
remove_pricing_rule_for_item(item) {
|
||||||
let me = this;
|
if (item.pricing_rules){
|
||||||
return this.frm.call({
|
let me = this;
|
||||||
method: "erpnext.accounts.doctype.pricing_rule.pricing_rule.remove_pricing_rule_for_item",
|
return this.frm.call({
|
||||||
args: {
|
method: "erpnext.accounts.doctype.pricing_rule.pricing_rule.remove_pricing_rule_for_item",
|
||||||
pricing_rules: item.pricing_rules,
|
args: {
|
||||||
item_details: {
|
pricing_rules: item.pricing_rules,
|
||||||
"doctype": item.doctype,
|
item_details: {
|
||||||
"name": item.name,
|
"doctype": item.doctype,
|
||||||
"item_code": item.item_code,
|
"name": item.name,
|
||||||
"pricing_rules": item.pricing_rules,
|
"item_code": item.item_code,
|
||||||
"parenttype": item.parenttype,
|
"pricing_rules": item.pricing_rules,
|
||||||
"parent": item.parent,
|
"parenttype": item.parenttype,
|
||||||
"price_list_rate": item.price_list_rate
|
"parent": item.parent,
|
||||||
|
"price_list_rate": item.price_list_rate
|
||||||
|
},
|
||||||
|
item_code: item.item_code,
|
||||||
|
rate: item.price_list_rate,
|
||||||
},
|
},
|
||||||
item_code: item.item_code,
|
callback: function(r) {
|
||||||
rate: item.price_list_rate,
|
if (!r.exc && r.message) {
|
||||||
},
|
me.remove_pricing_rule(r.message);
|
||||||
callback: function(r) {
|
me.calculate_taxes_and_totals();
|
||||||
if (!r.exc && r.message) {
|
if(me.frm.doc.apply_discount_on) me.frm.trigger("apply_discount_on");
|
||||||
me.remove_pricing_rule(r.message);
|
}
|
||||||
me.calculate_taxes_and_totals();
|
|
||||||
if(me.frm.doc.apply_discount_on) me.frm.trigger("apply_discount_on");
|
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
apply_pricing_rule(item, calculate_taxes_and_totals) {
|
apply_pricing_rule(item, calculate_taxes_and_totals) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user