summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models
diff options
context:
space:
mode:
Diffstat (limited to 'indoteknik_custom/models')
-rwxr-xr-xindoteknik_custom/models/purchase_order_line.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/indoteknik_custom/models/purchase_order_line.py b/indoteknik_custom/models/purchase_order_line.py
index 621373f4..8439df5d 100755
--- a/indoteknik_custom/models/purchase_order_line.py
+++ b/indoteknik_custom/models/purchase_order_line.py
@@ -22,15 +22,21 @@ class PurchaseOrderLine(models.Model):
help="Total % Margin in Sales Order Header")
delivery_amt_line = fields.Float('DeliveryAmtLine', compute='compute_delivery_amt_line')
line_no = fields.Integer('No', default=0)
- qty_available = fields.Float('Qty Available', compute='compute_qty_available')
+ qty_available = fields.Float('Qty Available', compute='compute_qty_stock')
+ qty_onhand = fields.Float('Qty On Hand', compute='compute_qty_stock')
+ qty_incoming = fields.Float('Qty Incoming', compute='compute_qty_stock')
+ qty_outgoing = fields.Float('Qty Outgoing', compute='compute_qty_stock')
- def compute_qty_available(self):
+ def compute_qty_stock(self):
for line in self:
line.qty_available = line.product_id.virtual_available
+ line.qty_onhand = line.product_id.qty_available
+ line.qty_incoming = line.product_id.incoming_qty
+ line.qty_outgoing = line.product_id.outgoing_qty
@api.onchange('product_id')
def _onchange_product_custom(self):
- self.compute_qty_available()
+ self.compute_qty_stock()
# Override method from addons/purchase/models/purchase.py
@api.onchange('product_qty', 'product_uom')