Skip to content
Snippets Groups Projects
Commit aedd0251 authored by Denis Ledoux's avatar Denis Ledoux
Browse files

[FIX] account: invoice onchange partner accounts properties

Since revision 7eab8e26
the `_onchange_partner_id` of `account.invoice` failed
if the SUPERUSER created an invoice for another company
than his own, and if the partner had not a specific
receivable or payable account (meaning the default
accounts are used, the accounts coming from the properties
of this company without any partner specified)
because
```
prop.search([
             ('name', '=', 'property_account_receivable_id'),
             ('company_id', '=', company_id)
            ])`
```
can return multiple records, if several partners
have their own receivable accounts set, and,
since the above revision,
`get_by_record` specify `ensure_one`, meaning
you cannot pass multiple records to this method.

This domain was built a the time
(2009, rev. 80861660)
to handle the multi-company property,
which can now be handle with a simple `force_company`
passed in the context. It was not the case at the time.

This revision could be applied in former releases,
but this is not a necessity. This is a necessity
in saas-10, because of the above revision.

opw-678536
parent bd9fc146
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment