Skip to content
Permalink
Browse files

[IMP] As `_compute_journal_domain_and_types` method is defined in an

abstract model it could be called by other models which could not bear
`has_invoices` field.
  • Loading branch information...
hbto committed Apr 19, 2019
1 parent 3539221 commit 77dc161a3b2dd766de35201530f86ecd68863364
Showing with 1 addition and 1 deletion.
  1. +1 −1 addons/account/models/account_payment.py
@@ -195,7 +195,7 @@ def _onchange_partner_id(self):
def _compute_journal_domain_and_types(self):
journal_type = ['bank', 'cash']
domain = []
if self.currency_id.is_zero(self.amount) and self.has_invoices:
if self.currency_id.is_zero(self.amount) and hasattr(self, "has_invoices") and self.has_invoices:
# In case of payment with 0 amount, allow to select a journal of type 'general' like
# 'Miscellaneous Operations' and set this journal by default.
journal_type = ['general']

0 comments on commit 77dc161

Please sign in to comment.
You can’t perform that action at this time.