[FIX] stock_valuation_xlsx: fix report when categ_subtotal is false

This commit is contained in:
Alexis de Lattre
2020-09-26 00:01:27 +02:00
parent 446c2c1f1d
commit a748de39ec

View File

@@ -415,6 +415,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
@@ -422,7 +423,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']