summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2022-08-23 17:10:12 +0700
committerstephanchrst <stephanchrst@gmail.com>2022-08-23 17:10:12 +0700
commitc3d42480e83f466f847bb0e8c051f45257de5cd2 (patch)
treefce3c2a8d7c9d2b429eb3834de7b13ef97519fa2
parentc369d67e08b50350705011e01b3f5ec78dcb7d11 (diff)
bug fix item margin if unit price equal zero
-rwxr-xr-xindoteknik_custom/models/sale_order.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py
index 50e6baa3..d9ef0b85 100755
--- a/indoteknik_custom/models/sale_order.py
+++ b/indoteknik_custom/models/sale_order.py
@@ -92,7 +92,7 @@ class SaleOrderLine(models.Model):
def compute_item_margin(self):
for line in self:
- if not line.product_id:
+ if not line.product_id or line.price_unit == 0:
line.item_margin = 0
line.item_percent_margin = 0
continue