Skip to content
Snippets Groups Projects
Commit 4b953544 authored by Nans Lefebvre's avatar Nans Lefebvre
Browse files

[FIX] sale: get correct account to create corresponding invoice


Sibling commit of 427280d9, same use case.

Be in company C1. Create the invoice I for a SO in company C2.
The invoice line is with an account created of C1.
This is because property_account_income_id or property_account_income_categ_id
are company dependent properties that need to be accessed with a force_company.
This happens when e.g. C2 is a child company of C1.
However, accounts are not readable across companies, so the resulting invoice
cannot be validated in either company, since there is a mix of accounts.

Note that in case force_company is False, it defaults to the user's company,
which is already the default.

opw 2068291

closes odoo/odoo#37037

Signed-off-by: default avatarNans Lefebvre (len) <len@odoo.com>
parent 427280d9
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