fix(Sales Invoice): Let invoice be created for Sold Assets if it's a return invoice

This commit is contained in:
GangaManoj 2021-06-21 23:51:09 +05:30
parent 600333875a
commit 5b07e58412

View File

@ -149,7 +149,7 @@ class SalesInvoice(SellingController):
if self.update_stock:
frappe.throw(_("'Update Stock' cannot be checked for fixed asset sale"))
elif asset.status in ("Scrapped", "Cancelled", "Sold"):
elif asset.status in ("Scrapped", "Cancelled") or asset.status == "Sold" and not self.is_return:
frappe.throw(_("Row #{0}: Asset {1} cannot be submitted, it is already {2}").format(d.idx, d.asset, asset.status))
def validate_item_cost_centers(self):