mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-05 21:29:11 +00:00
fix(Sales Invoice): Print appropriate message if Asset isn't specified when the Item is a Fixed Asset
This commit is contained in:
@@ -920,9 +920,10 @@ class SalesInvoice(SellingController):
|
|||||||
if item.get('asset'):
|
if item.get('asset'):
|
||||||
asset = frappe.get_doc("Asset", item.asset)
|
asset = frappe.get_doc("Asset", item.asset)
|
||||||
else:
|
else:
|
||||||
frappe.throw(_("Enter Asset linked with Item {0}: {1} in row {2}.")
|
frappe.throw(_(
|
||||||
.format(item.item_code, item.item_name, item.idx))
|
"Row #{0}: You must select an Asset for Item {1}.").format(item.idx, item.item_name),
|
||||||
|
title=_("Missing Asset")
|
||||||
|
)
|
||||||
if (len(asset.finance_books) > 1 and not item.finance_book
|
if (len(asset.finance_books) > 1 and not item.finance_book
|
||||||
and asset.finance_books[0].finance_book):
|
and asset.finance_books[0].finance_book):
|
||||||
frappe.throw(_("Select finance book for the item {0} at row {1}")
|
frappe.throw(_("Select finance book for the item {0} at row {1}")
|
||||||
|
|||||||
Reference in New Issue
Block a user