fix: last purchase rate for purchase invoice (backport #43448) (#43452)

* fix: last purchase rate for purchase invoice

(cherry picked from commit fb9d106633)

# Conflicts:
#	erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py

* chore: fix conflicts

---------

Co-authored-by: Rohit Waghchaure <rohitw1991@gmail.com>
This commit is contained in:
mergify[bot]
2024-10-01 12:54:26 +05:30
committed by GitHub
parent 15b34a607f
commit ee2c8c869a
4 changed files with 71 additions and 30 deletions

View File

@@ -1277,6 +1277,10 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe
.filter(Boolean).length > 0;
} else if (this.frm.doc?.items) {
let first_row = this.frm.doc.items[0];
if (!first_row) {
return false
};
let mapped_rows = mappped_fields.filter(d => first_row[d])
return mapped_rows?.length > 0;