[IMP] base: use avg group_operator for currency rate

If records are grouped by date, the avg aggregation
makes a more meanignful value

closes odoo/odoo#59577

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
This commit is contained in:
Lois Rilo
2020-10-09 08:31:42 +00:00
parent 7f10e89d21
commit a6644a7dd6
+1 -1
View File
@@ -235,7 +235,7 @@ class CurrencyRate(models.Model):
name = fields.Date(string='Date', required=True, index=True,
default=lambda self: fields.Date.today())
rate = fields.Float(digits=0, default=1.0, help='The rate of the currency to the currency of rate 1')
rate = fields.Float(digits=0, default=1.0, group_operator="avg", help='The rate of the currency to the currency of rate 1')
currency_id = fields.Many2one('res.currency', string='Currency', readonly=True, required=True, ondelete="cascade")
company_id = fields.Many2one('res.company', string='Company',
default=lambda self: self.env.company)