diff options
| author | Mqdd <ahmadmiqdad27@gmail.com> | 2026-02-26 09:10:46 +0700 |
|---|---|---|
| committer | Mqdd <ahmadmiqdad27@gmail.com> | 2026-02-26 09:10:46 +0700 |
| commit | e4867b6a6e7599ff535b171025d1e5b8561ce891 (patch) | |
| tree | 0fca7e3c69778c78aac0823d70d10af440ba2ded | |
| parent | 5de479edc054edc241a1d8088cf8e06108fb0c7d (diff) | |
<Miqdad> fix bill remain logic when add item in Add PO Item
| -rw-r--r-- | fixco_custom/models/account_move.py | 6 |
1 files changed, 1 insertions, 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() |
