fix: Performance improvement when adding a new item (#34195)

fix: Performance improvement when adding a new item

(cherry picked from commit 49af5ba434)

Co-authored-by: HarryPaulo <paulo_fabris@hotmail.com>
Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
This commit is contained in:
mergify[bot]
2023-03-07 15:46:18 +05:30
committed by GitHub
parent 64c758d0c0
commit 71a281fb11

View File

@@ -488,7 +488,7 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe
() => {
var d = locals[cdt][cdn];
me.add_taxes_from_item_tax_template(d.item_tax_rate);
if (d.free_item_data) {
if (d.free_item_data && d.free_item_data.length > 0) {
me.apply_product_discount(d);
}
},