Skip to content
Snippets Groups Projects
Commit ceb5c2be authored by Yannick Tivisse's avatar Yannick Tivisse
Browse files

[FIX] account: Pass correct company and date to _convert on dashboard rendering

parent c35e24aa
Branches
Tags
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment