[FIX] stock_valuation_xlsx: fix report when categ_subtotal is false

This commit is contained in:
Alexis de Lattre
2020-09-25 23:57:56 +02:00
parent a4ca584e90
commit 80f5341da0

View File

@@ -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']