diff options
Diffstat (limited to 'indoteknik_custom/models')
| -rwxr-xr-x | indoteknik_custom/models/purchase_order_line.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/indoteknik_custom/models/purchase_order_line.py b/indoteknik_custom/models/purchase_order_line.py index f255095f..1b5bba3a 100755 --- a/indoteknik_custom/models/purchase_order_line.py +++ b/indoteknik_custom/models/purchase_order_line.py @@ -28,6 +28,18 @@ class PurchaseOrderLine(models.Model): qty_outgoing = fields.Float('Qty Outgoing', compute='compute_qty_stock') qty_available_store = fields.Float(string='Available') suggest = fields.Char(string='Suggest') + price_vendor = fields.Float(string='Price Vendor', compute='compute_price_vendor') + + + def compute_price_vendor(self): + for line in self: + purchase_pricelist = self.env['purchase.pricelist'].search([ + ('product_id', '=', line.product_id.id), + ('vendor_id', '=', line.partner_id.id) + ], limit=1) + + price_vendor = purchase_pricelist.product_price + line.price_vendor = price_vendor def compute_qty_stock(self): for line in self: |
