From b7385a10af5510851e08c81517603c6655be6cdf Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Fri, 13 Dec 2024 12:17:07 +0530 Subject: [PATCH] fix: incorrect status of the purchase receipt --- erpnext/controllers/status_updater.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/erpnext/controllers/status_updater.py b/erpnext/controllers/status_updater.py index e04618c857fa..db3bb16bc02e 100644 --- a/erpnext/controllers/status_updater.py +++ b/erpnext/controllers/status_updater.py @@ -94,7 +94,10 @@ def validate_status(status, options): ["To Bill", "eval:self.per_billed == 0 and self.docstatus == 1"], ["Partly Billed", "eval:self.per_billed > 0 and self.per_billed < 100 and self.docstatus == 1"], ["Return Issued", "eval:self.per_returned == 100 and self.docstatus == 1"], - ["Completed", "eval:self.per_billed == 100 and self.docstatus == 1"], + [ + "Completed", + "eval:(self.per_billed == 100 and self.docstatus == 1) or (self.docstatus == 1 and self.grand_total == 0 and self.per_returned != 100 and self.is_return == 0)", + ], ["Cancelled", "eval:self.docstatus==2"], ["Closed", "eval:self.status=='Closed' and self.docstatus != 2"], ],