diff options
| author | IT Fixcomart <it@fixcomart.co.id> | 2023-08-09 08:12:22 +0000 |
|---|---|---|
| committer | IT Fixcomart <it@fixcomart.co.id> | 2023-08-09 08:12:22 +0000 |
| commit | 7ef85851c3c097a5e67596ac2630d0e8268dd008 (patch) | |
| tree | a4a48e6348cdb4812ca71356bfd4fa4ceb137698 /indoteknik_custom/models/purchase_order_line.py | |
| parent | 207c8f4f288e841d4f69525c9d688f230d116ff6 (diff) | |
| parent | 9a5b528c2d5afc4b6f1da30e14167b0bc33ae923 (diff) | |
Merged in production (pull request #93)
Production
Diffstat (limited to 'indoteknik_custom/models/purchase_order_line.py')
| -rwxr-xr-x | indoteknik_custom/models/purchase_order_line.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/indoteknik_custom/models/purchase_order_line.py b/indoteknik_custom/models/purchase_order_line.py index f255095f..39aeba0f 100755 --- a/indoteknik_custom/models/purchase_order_line.py +++ b/indoteknik_custom/models/purchase_order_line.py @@ -28,6 +28,21 @@ 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.order_id.partner_id.id) + ], limit=1) + + if purchase_pricelist: + price_vendor = format(purchase_pricelist.product_price, ".2f") + price_vendor = float(price_vendor) + line.price_vendor = price_vendor + else: + line.price_vendor = 0 def compute_qty_stock(self): for line in self: |
