From 10db08f6db326d236efc8a4e3d9d91fbff931ed8 Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Wed, 16 Aug 2023 13:37:24 +0700 Subject: Fix default total_percent_margin on sale order --- indoteknik_custom/models/sale_order.py | 1 + 1 file changed, 1 insertion(+) diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py index 036fba1b..ca98cde4 100755 --- a/indoteknik_custom/models/sale_order.py +++ b/indoteknik_custom/models/sale_order.py @@ -360,6 +360,7 @@ class SaleOrder(models.Model): def _compute_total_percent_margin(self): for order in self: if order.amount_untaxed == 0: + order.total_percent_margin = 0 continue order.total_percent_margin = round((order.total_margin / order.amount_untaxed) * 100, 2) -- cgit v1.2.3