diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2023-08-08 09:47:05 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2023-08-08 09:47:05 +0700 |
| commit | a39466421a31d2ffd5f2252bf7aac903c4785d83 (patch) | |
| tree | afec474180897413ff61396710e49d891795df57 /indoteknik_custom/models | |
| parent | e183c6bcc694810e508bb7689f1103d0e34f0527 (diff) | |
add field price vendor
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: |
