[FIX] account_voucher: default currency

- Go to Accounting > Configuration > Journals.
- In the form view of a journal, click on Action > Voucher Entries
- Click on Create => traceback

opw-771415
This commit is contained in:
Nicolas Martinelli
2017-09-12 17:11:14 +02:00
parent 39964e6cf2
commit 6318ff6675
@@ -82,7 +82,7 @@ class AccountVoucher(models.Model):
@api.model
def _get_currency(self):
journal = self.env['account.journal'].browse(self._context.get('journal_id', False))
journal = self.env['account.journal'].browse(self.env.context.get('default_journal_id', False))
if journal.currency_id:
return journal.currency_id.id
return self.env.user.company_id.currency_id.id