fix: Remove free items
This commit is contained in:
parent
55c0770280
commit
0581000990
@ -1360,7 +1360,11 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe
|
|||||||
var item_list = [];
|
var item_list = [];
|
||||||
|
|
||||||
$.each(this.frm.doc["items"] || [], function(i, d) {
|
$.each(this.frm.doc["items"] || [], function(i, d) {
|
||||||
if (d.item_code && !d.is_free_item) {
|
if (d.item_code) {
|
||||||
|
if (d.is_free_item) {
|
||||||
|
// Simply remove free items
|
||||||
|
me.frm.get_field("items").grid.grid_rows[i].remove();
|
||||||
|
} else {
|
||||||
item_list.push({
|
item_list.push({
|
||||||
"doctype": d.doctype,
|
"doctype": d.doctype,
|
||||||
"name": d.name,
|
"name": d.name,
|
||||||
@ -1371,6 +1375,7 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe
|
|||||||
"price_list_rate": d.price_list_rate
|
"price_list_rate": d.price_list_rate
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
return this.frm.call({
|
return this.frm.call({
|
||||||
method: "erpnext.accounts.doctype.pricing_rule.pricing_rule.remove_pricing_rules",
|
method: "erpnext.accounts.doctype.pricing_rule.pricing_rule.remove_pricing_rules",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user