[FIX] stock_account: groupby

Set the groupby according to what is done in `_read_group_raw`.

opw-816358
This commit is contained in:
Nicolas Martinelli
2018-02-21 14:03:40 +01:00
committed by Nicolas Martinelli
parent e2280783a2
commit 1fa6b63c0f
+1 -1
View File
@@ -30,7 +30,7 @@ class StockHistory(models.Model):
# on the individual lines.
res = super(StockHistory, self).read_group(domain, fields, groupby, offset=offset, limit=limit, orderby=orderby, lazy=lazy)
if 'inventory_value' in fields:
groupby_list = groupby if not lazy else groupby[:-1]
groupby_list = groupby[:1] if lazy else groupby
date = self._context.get('history_date', fieldsDatetime.now())
# Step 2: retrieve the stock history lines. The result contains the 'expanded'