summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2022-12-21 10:55:53 +0700
committerstephanchrst <stephanchrst@gmail.com>2022-12-21 10:55:53 +0700
commit8b681ddd7cf2823bdf7cd276500bb6ded9a5ab1e (patch)
treeb26cb0d76c24956c53949bdea44202d7974f772b /indoteknik_custom/models
parent6f46bca1d6483d2d95c95a2d34b0dc9a5e6061f5 (diff)
add qty onhand, incoming, and outgoing
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')