summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xindoteknik_custom/models/sale_order.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py
index d56a7946..c1c2c267 100755
--- a/indoteknik_custom/models/sale_order.py
+++ b/indoteknik_custom/models/sale_order.py
@@ -138,8 +138,14 @@ class SaleOrder(models.Model):
total_weight = fields.Float(string='Total Weight', compute='_compute_total_weight')
def _compute_total_weight(self):
- for order in self:
- order.total_weight = sum(line.weight for line in order.order_line)
+ total_weight = 0
+ missing_weight_products = []
+
+ for line in self.order_line:
+ if line.weight:
+ total_weight += line.weight * line.product_uom_qty
+
+ self.total_weight = total_weight
def action_indoteknik_estimate_shipping(self):
if not self.real_shipping_id.kota_id.is_jabodetabek: