From 80f5341da0eaef1f94b69778bc293ae18e702a10 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Fri, 25 Sep 2020 23:57:56 +0200 Subject: [PATCH] [FIX] stock_valuation_xlsx: fix report when categ_subtotal is false --- stock_valuation_xlsx/wizard/stock_valuation_xlsx.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/stock_valuation_xlsx/wizard/stock_valuation_xlsx.py b/stock_valuation_xlsx/wizard/stock_valuation_xlsx.py index 1614bdd..6bb9b52 100644 --- a/stock_valuation_xlsx/wizard/stock_valuation_xlsx.py +++ b/stock_valuation_xlsx/wizard/stock_valuation_xlsx.py @@ -418,6 +418,7 @@ class StockValuationXlsx(models.TransientModel): letter_price = cols['standard_price']['pos_letter'] letter_subtotal = cols['subtotal']['pos_letter'] crow = 0 + lines = res for categ_id in categ_ids: ctotal = 0.0 categ_has_line = False @@ -425,7 +426,8 @@ class StockValuationXlsx(models.TransientModel): # skip a line and save it's position as crow i += 1 crow = i - for l in filter(lambda x: x['categ_id'] == categ_id, res): + lines = filter(lambda x: x['categ_id'] == categ_id, res) + for l in lines: i += 1 total += l['subtotal'] ctotal += l['subtotal']