From c98b2b59181546f246912fcd8c649ae773b68fab Mon Sep 17 00:00:00 2001 From: anandbaburajan Date: Fri, 3 Feb 2023 22:58:22 +0530 Subject: [PATCH] fix: allow PI cancel if linked asset is cancelled (cherry picked from commit b961321de5447fe8049472f51ae89f1a3ff76665) --- erpnext/controllers/buying_controller.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/erpnext/controllers/buying_controller.py b/erpnext/controllers/buying_controller.py index 445620a1246..31e5dd777f3 100644 --- a/erpnext/controllers/buying_controller.py +++ b/erpnext/controllers/buying_controller.py @@ -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: + break if asset.docstatus == 0: asset.set(field, None) asset.supplier = None