Group on company currency in sale reporting

It is needed to construct unique ID when grouping by other mean than the line id.
Also the revenue is computed in the company currency.

Closes #13744
This commit is contained in:
Cédric Krier committed 2024-12-12 00:42:58 +01:00
1 parent 44957156d3
commit 7e5ef52975
1 file changed
+2 -2
+2 -2
View File
@@ -136,7 +136,7 @@ class Abstract(ModelSQL):
line.company.as_('company'),
revenue.as_('revenue'),
Count(line.order, distinct=True).as_('number'),
line.currency.as_('currency'),
currency.id.as_('currency'),
]
@classmethod
@@ -148,7 +148,7 @@ class Abstract(ModelSQL):
def _group_by(cls, tables, withs):
line = tables['line']
currency = tables['line.company.currency']
return [line.company, line.currency, currency.digits]
return [line.company, currency.id, currency.digits]
@classmethod
def _where(cls, tables, withs):