summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xindoteknik_custom/models/purchase_order_line.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/indoteknik_custom/models/purchase_order_line.py b/indoteknik_custom/models/purchase_order_line.py
index 24afcab6..55381c6d 100755
--- a/indoteknik_custom/models/purchase_order_line.py
+++ b/indoteknik_custom/models/purchase_order_line.py
@@ -37,7 +37,7 @@ class PurchaseOrderLine(models.Model):
def compute_item_margin(self):
for line in self:
- if not line.product_id or line.price_unit <= 0 or line.product_uom_qty <= 0 or line.product_id.type == 'service':
+ if not line.product_id or line.price_unit <= 0 or line.product_uom_qty <= 0 or line.product_id.type == 'service' or not line.order_id.sale_order_id.id:
line.item_margin = 0
line.item_percent_margin = 0
continue