[FIX] account: Pass correct company and date to _convert on dashboard rendering
This commit is contained in:
@@ -241,11 +241,11 @@ class account_journal(models.Model):
|
||||
rslt_sum = 0.0
|
||||
for result in results_dict:
|
||||
cur = self.env['res.currency'].browse(result.get('currency'))
|
||||
company = self.env['res.company'].browse(result.get('company_id'))
|
||||
company = self.env['res.company'].browse(result.get('company_id')) or self.env.user.company_id
|
||||
rslt_count += 1
|
||||
type_factor = result.get('type') in ('in_refund', 'out_refund') and -1 or 1
|
||||
rslt_sum += type_factor * cur._convert(
|
||||
result.get('amount_total'), target_currency, company, result.get('date') or fields.Date.today())
|
||||
result.get('amount_total'), target_currency, company, result.get('date_invoice') or fields.Date.today())
|
||||
return (rslt_count, rslt_sum)
|
||||
|
||||
@api.multi
|
||||
|
||||
Reference in New Issue
Block a user