From e4867b6a6e7599ff535b171025d1e5b8561ce891 Mon Sep 17 00:00:00 2001 From: Mqdd Date: Thu, 26 Feb 2026 09:10:46 +0700 Subject: fix bill remain logic when add item in Add PO Item --- fixco_custom/models/account_move.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/fixco_custom/models/account_move.py b/fixco_custom/models/account_move.py index 3ec7e5e..028e2cb 100644 --- a/fixco_custom/models/account_move.py +++ b/fixco_custom/models/account_move.py @@ -395,10 +395,7 @@ class PurchaseOrderLineWizard(models.TransientModel): def action_add_lines(self): for item in self.line_ids: - if item.qty_received <= 0: - raise UserError(f"Line {item.name} has no received quantity.") - - if item.qty_invoiced >= item.qty_received: + if item.bill_remain <= 0: raise UserError(f"Item: {item.name} from PO: {item.order_id.name} has already been fully invoiced.") self.ensure_one() @@ -424,7 +421,6 @@ class PurchaseOrderLineWizard(models.TransientModel): line = new_lines.new(vals) - # WAJIB supaya account kecompute benar line.account_id = line._get_computed_account() line._onchange_price_subtotal() -- cgit v1.2.3