From e2cf1d6002a28389e92ceea926ebe482031b7e62 Mon Sep 17 00:00:00 2001 From: Jared Kipe Date: Sun, 30 Dec 2018 10:25:24 -0800 Subject: [PATCH] FIX divide by Zero issue. --- pos_product_catch_weight/models/pos_order.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pos_product_catch_weight/models/pos_order.py b/pos_product_catch_weight/models/pos_order.py index a2dac987..18b81114 100644 --- a/pos_product_catch_weight/models/pos_order.py +++ b/pos_product_catch_weight/models/pos_order.py @@ -38,7 +38,7 @@ class PosOrderLine(models.Model): lot_ratio_sum += l.lot_catch_weight_ratio else: lot_ratio_sum += 1.0 - if lot_ratio_sum != 0.0: + if lot_ratio_sum != 0.0 and line.qty: lot_ratio = lot_ratio_sum / line.qty price = (line.price_unit * lot_ratio) * (1 - (line.discount or 0.0) / 100.0)