Merge pull request #32984 from nabinhait/si-needs-repost
fix: Validate for deferred revenue only if sales invoice needs repost
This commit is contained in:
commit
0486078ba9
@ -571,13 +571,14 @@ class SalesInvoice(SellingController):
|
|||||||
|
|
||||||
# validate if deferred revenue is enabled for any item
|
# validate if deferred revenue is enabled for any item
|
||||||
# Don't allow to update the invoice if deferred revenue is enabled
|
# Don't allow to update the invoice if deferred revenue is enabled
|
||||||
for item in self.get("items"):
|
if needs_repost:
|
||||||
if item.enable_deferred_revenue:
|
for item in self.get("items"):
|
||||||
frappe.throw(
|
if item.enable_deferred_revenue:
|
||||||
_(
|
frappe.throw(
|
||||||
"Deferred Revenue is enabled for item {0}. You cannot update the invoice after submission."
|
_(
|
||||||
).format(item.item_code)
|
"Deferred Revenue is enabled for item {0}. You cannot update the invoice after submission."
|
||||||
)
|
).format(item.item_code)
|
||||||
|
)
|
||||||
|
|
||||||
self.db_set("repost_required", needs_repost)
|
self.db_set("repost_required", needs_repost)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user