summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/purchase_order_line.py
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2022-09-28 17:17:44 +0700
committerstephanchrst <stephanchrst@gmail.com>2022-09-28 17:17:44 +0700
commitac37a854362dbaaf8a88431ea5ab077a37f3c5f9 (patch)
tree9e2774cd88cc935bf6d7a87c2a73011090660f0e /indoteknik_custom/models/purchase_order_line.py
parent597d6458234a14bd20e7fba8a0ceb07168423d2a (diff)
Update purchase_order.py and purchase_order_line.py
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