Skip to content

Commit

Permalink
[FIX] account: crash if no default journal be set on invoice creation…
Browse files Browse the repository at this point in the history
… from PO

When creating an invoice from Purchase Order(stat button) if you do not have a journal of type 'Purchase' defined for current user's company, it will crash.
  • Loading branch information
rgo-odoo authored and nim-odoo committed Feb 14, 2017
1 parent fe40560 commit 22ac4de
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion addons/account/models/account_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def _default_journal(self):
@api.model
def _default_currency(self):
journal = self._default_journal()
return journal.currency_id or journal.company_id.currency_id
return journal.currency_id or journal.company_id.currency_id or self.env.user.company_id.currency_id

@api.model
def _get_reference_type(self):
Expand Down

0 comments on commit 22ac4de

Please sign in to comment.