Skip to content

Commit

Permalink
[FIX] account: usability fix when no partner and journal set
Browse files Browse the repository at this point in the history
when an account.payment object had no partner and no journal, the computation of is_internal_transfer was wrongly computed as True... and the information banner was displayed accordingly

closes odoo#77122

Signed-off-by: Quentin De Paoli (qdp) <[email protected]>
  • Loading branch information
qdp-odoo committed Sep 24, 2021
1 parent bb61168 commit 65dec30
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion addons/account/models/account_payment.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ def _compute_partner_bank_id(self):
@api.depends('partner_id', 'destination_account_id', 'journal_id')
def _compute_is_internal_transfer(self):
for payment in self:
payment.is_internal_transfer = payment.partner_id == payment.journal_id.company_id.partner_id
payment.is_internal_transfer = payment.partner_id and payment.partner_id == payment.journal_id.company_id.partner_id

@api.depends('payment_type', 'journal_id')
def _compute_payment_method_line_id(self):
Expand Down

0 comments on commit 65dec30

Please sign in to comment.