summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/purchase_order_line.py
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2023-08-08 15:29:29 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2023-08-08 15:29:29 +0700
commit30eb623bace6b5ba9a1e275c7bdf70fc5920a583 (patch)
tree658f4f69814ee716f77b9ead739664c2b14c36b6 /indoteknik_custom/models/purchase_order_line.py
parenta39466421a31d2ffd5f2252bf7aac903c4785d83 (diff)
sync price unit po & price purchase pricelist
Diffstat (limited to 'indoteknik_custom/models/purchase_order_line.py')
-rwxr-xr-xindoteknik_custom/models/purchase_order_line.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/indoteknik_custom/models/purchase_order_line.py b/indoteknik_custom/models/purchase_order_line.py
index 1b5bba3a..450d3430 100755
--- a/indoteknik_custom/models/purchase_order_line.py
+++ b/indoteknik_custom/models/purchase_order_line.py
@@ -30,15 +30,15 @@ class PurchaseOrderLine(models.Model):
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)
+ ('vendor_id', '=', line.order_id.partner_id.id)
], limit=1)
- price_vendor = purchase_pricelist.product_price
+ price_vendor = format(purchase_pricelist.product_price, ".2f")
+ price_vendor = float(price_vendor)
line.price_vendor = price_vendor
def compute_qty_stock(self):