summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIT Fixcomart <it@fixcomart.co.id>2022-08-23 10:12:58 +0000
committerIT Fixcomart <it@fixcomart.co.id>2022-08-23 10:12:58 +0000
commitf92a148445a4c5de3d4e80d051783f7af5813d32 (patch)
treefce3c2a8d7c9d2b429eb3834de7b13ef97519fa2
parent6aa301a106b822234af2812c9633f5b907ad2c53 (diff)
parentc3d42480e83f466f847bb0e8c051f45257de5cd2 (diff)
Merged in development (pull request #2)
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