Skip to content
Snippets Groups Projects
Commit 1db37172 authored by Nicolas Martinelli's avatar Nicolas Martinelli
Browse files

[FIX] account: incorrect bank account domain


- Set 2 banks accounts for a partner A
- Create a credit note
- Choose partner A => a default bank account is chosen, and both are
available in the list.
- Save, go back to the tree view, then reopen the same credit note

It is not possible to choose among both bank accounts anymore.

It is due to the domain set on the view, which is valid for customer
invoices but not for credit notes. It works at creation since
`_onchange_partner_id` overrides the domain for `out_refund`.

In this specific case, a domain in the view is not appropriate: the same
view is used for 2 invoice types although they require a different
domain. Therefore we set the domain only in the onchange. The drawback
is that all bank accounts are shown when we reopen a customer invoice or
a credit note from the tree view since the onchange is not triggered.
However, the constraint `validate_partner_bank_id` still protects
against an incorrect configuration.

opw-2010017

closes odoo/odoo#34292

Signed-off-by: default avatarNicolas Martinelli (nim) <nim@odoo.com>
parent 5bb9a8b4
Branches
Tags
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment