summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/purchase_order_line.py
diff options
context:
space:
mode:
Diffstat (limited to 'indoteknik_custom/models/purchase_order_line.py')
-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 fcfab1da..4965b507 100755
--- a/indoteknik_custom/models/purchase_order_line.py
+++ b/indoteknik_custom/models/purchase_order_line.py
@@ -42,7 +42,7 @@ class PurchaseOrderLine(models.Model):
def compute_item_margin(self):
sum_so_margin = sum_sales_price = sum_margin = 0
for line in self:
- if not line.product_id or line.product_id.type == 'service':
+ if not line.product_id or line.product_id.type == 'service' or not self.order_id.sale_order_id:
line.so_item_margin = 0
line.so_item_percent_margin = 0
line.item_margin = 0