Merge pull request #33962 from frappe/mergify/bp/version-14-hotfix/pr-33946

fix: allow cancelling purchase invoice if linked asset is already cancelled (backport #33946)
This commit is contained in:
Anand Baburajan
2023-02-05 17:11:53 +05:30
committed by GitHub

View File

@@ -716,6 +716,8 @@ class BuyingController(SubcontractingController):
asset.purchase_date = self.posting_date
asset.supplier = self.supplier
elif self.docstatus == 2:
if asset.docstatus == 2:
continue
if asset.docstatus == 0:
asset.set(field, None)
asset.supplier = None