From c3d42480e83f466f847bb0e8c051f45257de5cd2 Mon Sep 17 00:00:00 2001 From: stephanchrst Date: Tue, 23 Aug 2022 17:10:12 +0700 Subject: bug fix item margin if unit price equal zero --- indoteknik_custom/models/sale_order.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- cgit v1.2.3