fix: ignore pricing rule for other item group

This commit is contained in:
Rohit Waghchaure 2020-01-02 17:29:50 +05:30
parent 2d293c585e
commit 660a78b877
2 changed files with 9 additions and 2 deletions

View File

@ -495,7 +495,7 @@ def get_pricing_rule_items(pr_doc):
if pr_doc.apply_rule_on_other: if pr_doc.apply_rule_on_other:
apply_on = frappe.scrub(pr_doc.apply_rule_on_other) apply_on = frappe.scrub(pr_doc.apply_rule_on_other)
apply_on_data.append(pr_doc.get(apply_on)) apply_on_data.append(pr_doc.get("other_" + apply_on))
return list(set(apply_on_data)) return list(set(apply_on_data))

View File

@ -1398,7 +1398,8 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
remove_pricing_rule: function(item) { remove_pricing_rule: function(item) {
let me = this; let me = this;
const fields = ["discount_percentage", "discount_amount", "pricing_rules"]; const fields = ["discount_percentage",
"discount_amount", "margin_rate_or_amount", "rate_with_margin"];
if(item.remove_free_item) { if(item.remove_free_item) {
var items = []; var items = [];
@ -1418,6 +1419,12 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
fields.forEach(f => { fields.forEach(f => {
row[f] = 0; row[f] = 0;
}); });
["pricing_rules", "margin_type"].forEach(field => {
if (row[field]) {
row[field] = '';
}
})
} }
}); });