diff options
| author | stephanchrst <stephanchrst@gmail.com> | 2022-09-28 17:17:44 +0700 |
|---|---|---|
| committer | stephanchrst <stephanchrst@gmail.com> | 2022-09-28 17:17:44 +0700 |
| commit | ac37a854362dbaaf8a88431ea5ab077a37f3c5f9 (patch) | |
| tree | 9e2774cd88cc935bf6d7a87c2a73011090660f0e /indoteknik_custom/models/purchase_order_line.py | |
| parent | 597d6458234a14bd20e7fba8a0ceb07168423d2a (diff) | |
Update purchase_order.py and purchase_order_line.py
Diffstat (limited to 'indoteknik_custom/models/purchase_order_line.py')
| -rwxr-xr-x | indoteknik_custom/models/purchase_order_line.py | 2 |
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 |
