[FIX] account: crash if no default journal be set on invoice creation 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.
This commit is contained in:
committed by
Nicolas Martinelli
parent
fe40560c31
commit
22ac4deb94
@@ -74,7 +74,7 @@ class AccountInvoice(models.Model):
|
||||
@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):
|
||||
|
||||
Reference in New Issue
Block a user