Files
odoo_source/addons/project_purchase/models
Victor Piryns (pivi) 9ffe67a975 [FIX] project_purchase: consider analytic_distribution in costs
Current behaviour:
Project Update doesn't take into consideration the `analytic_distribution`
percentage of the analytic_account on the line of the purchase orders.

Expected behaviour:
Account correctly for the % of the analytic account for the project,
just like in the Accounting app.

Steps to reproduce:
- Install Accounting, Sales, Purchase, Timesheet, Inventory, Project
- Activate "Analytic accounts" in Settings
- Create a product service which is creating a project at sales
- Create a new SO, add the service, confirm the SO and invoice
- Create a new PO, add some random product, on that same line add 2
analytic account, 50% of the SO project we just created, and 50% from any other.
- Confirm the PO
- Go to the SO's project update section, observe the cost is 100% of the line cost, not 50%

Reason for the problem:
`analytic_distribution` ratios are not taken into account when calculation the costs
of the project.

Fix:
Get the ratio of the `analytic_distribution` and multiply by it when processing the costs

Affected versions:
- 16.0
- master

opw-3079537

closes odoo/odoo#108222

X-original-commit: b676222c129863c154efb48e454e144b77157617
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2022-12-19 11:33:49 +01:00
..