summaryrefslogtreecommitdiff
path: root/fixco_custom/models/purchase_order_line.py
diff options
context:
space:
mode:
Diffstat (limited to 'fixco_custom/models/purchase_order_line.py')
-rw-r--r--fixco_custom/models/purchase_order_line.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/fixco_custom/models/purchase_order_line.py b/fixco_custom/models/purchase_order_line.py
index 53a5eba..bdd729c 100644
--- a/fixco_custom/models/purchase_order_line.py
+++ b/fixco_custom/models/purchase_order_line.py
@@ -38,6 +38,13 @@ class PurchaseOrderLine(models.Model):
original_price_subtotal = fields.Float(string='Original Subtotal', readonly=True)
description = fields.Text(string='Description', readonly=True, copy=False)
docstatus_altama = fields.Text(string='Status Altama', readonly=True, copy=False)
+ bill_remain = fields.Float(string='Bill Remain', readonly=True, copy=False, tracking=True, compute='_compute_bill_remain')
+
+ @api.depends('qty_invoiced', 'product_qty')
+ def _compute_bill_remain(self):
+ for line in self:
+ line.bill_remain = line.product_qty - line.qty_invoiced
+
@api.constrains('product_id', 'price_unit', 'product_qty')
def _store_original_price(self):