diff options
Diffstat (limited to 'indoteknik_custom/models/purchase_order_line.py')
| -rwxr-xr-x | indoteknik_custom/models/purchase_order_line.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/indoteknik_custom/models/purchase_order_line.py b/indoteknik_custom/models/purchase_order_line.py index 450d3430..39aeba0f 100755 --- a/indoteknik_custom/models/purchase_order_line.py +++ b/indoteknik_custom/models/purchase_order_line.py @@ -37,9 +37,12 @@ class PurchaseOrderLine(models.Model): ('vendor_id', '=', line.order_id.partner_id.id) ], limit=1) - price_vendor = format(purchase_pricelist.product_price, ".2f") - price_vendor = float(price_vendor) - line.price_vendor = price_vendor + 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: |
