Anh Thao Pham (pta) 50905d5691 [FIX] account: use account receivable/payable defined on partner for company partner
Steps to reproduce:
- Install Accounting & Contacts
- Go to Contacts and open partner linked to a res.company (e.g. YourCompany)
- Select another value for Account Receivable (e.g. Account Receivable (Pos))
- Go to Accounting and create an invoice for YourCompany
- Check Journal Items
The used Account Receivable is not the one configured on the partner,
but the default one from the company.
The issue only happens for the "res.partner" linked to a "res.company".

Cause:
When computing the available accounts, a dict is generated with the following
structure: {(model, id, account_type): account_id}.
dict of keys: tuple (model, id, account_type)
        values: int (account_id)
This dict is generated from several sources that are merged together.
One source (aka "properties") is the accounts configured on the partners.
In our example, such an entry is {('res.partner', 1, 'asset_receivable'): 35}.
Another source (aka "default_properties") is the default accounts configured on
the companies. From these data, entries are generated for the partners linked to
the companies.
In our example, YourCompany "res.partner" is linked to YourCompany "res.company
and the following entry is generated: {('res.partner', 1, 'asset_receivable'): 6}.
The key of this entry is exactly the same as the key of the entry from the other
source and is overriding its value in the final dict once merged.

Solution:
The data from "properties" should be the main ones and the data from
"default_properties" should be used as fallback.
This can be done by changing the order of the merge.

opw-3465767

closes odoo/odoo#139255

X-original-commit: ab47c12902087a2625fe079903ec3b1753ae7b3e
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Anh Thao Pham (pta) <pta@odoo.com>
2023-10-20 05:10:00 +00:00
…
…
…
…
…
…

Build Status Tech Doc Help Nightly Builds

Odoo

Odoo is a suite of web based open source business apps.

The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, ...

Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.

Getting started with Odoo

For a standard installation please follow the Setup instructions from the documentation.

To learn the software, we recommend the Odoo eLearning, or Scale-up, the business game. Developers can start with the developer tutorials

S
Description
No description provided
Readme LGPL-3.0
3.4 GiB
Languages
Python 49.6%
JavaScript 47.8%
SCSS 2%
CSS 0.3%
HTML 0.2%