Pejay
October 2, 2024, 7:49am
1
In my case, I already add property setter to remove the mandatory depends on, but when I save it still requires me to input gross purchase amount. Thank you
Jeel
October 2, 2024, 8:41am
2
@peejay mandatory is coming from validate method
)
else:
finance_books.add(d.finance_book)
if not d.finance_book:
frappe.throw(
_("Row #{}: Finance Book should not be empty since you're using multiple.").format(d.idx),
title=_("Missing Finance Book"),
)
def validate_asset_values(self):
if not self.asset_category:
self.asset_category = frappe.get_cached_value("Item", self.item_code, "asset_category")
if not flt(self.gross_purchase_amount) and not self.is_composite_asset:
frappe.throw(_("Gross Purchase Amount is mandatory"), frappe.MandatoryError)
if is_cwip_accounting_enabled(self.asset_category):
if (
not self.is_existing_asset
and not self.is_composite_asset
1 Like