From afdb0e682007647ac23bcd0322fcaf87fee1af19 Mon Sep 17 00:00:00 2001 From: Osval Reyes Date: Wed, 2 Dec 2015 14:15:02 -0430 Subject: [PATCH] [REF] crm_rma_stock_location: simplify rma on hand and forecasted quantities calculation --- crm_rma_stock_location/models/product_template.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crm_rma_stock_location/models/product_template.py b/crm_rma_stock_location/models/product_template.py index 8059e33b..5b922747 100644 --- a/crm_rma_stock_location/models/product_template.py +++ b/crm_rma_stock_location/models/product_template.py @@ -45,6 +45,6 @@ class ProductTemplate(models.Model): def _rma_template_available(self): for product in self: product.rma_qty_available = sum( - [p.rma_qty_available for p in product.product_variant_ids]) + product.mapped('product_variant_ids.rma_virtual_available')) product.rma_virtual_available = sum( - [p.rma_virtual_available for p in product.product_variant_ids]) + product.mapped('product_variant_ids.rma_virtual_available'))