odoo/odoo#194300

Created by Bugfix, Kawtar Drissi El Bouzaidi (kdeb)
Merged at e614f082a95a249e4abc29ee7a7e3a3bcaedd9ea

Statuses:

label
odoo-dev:16.0-OPW-4416931-project_purchase_account_negative_entry_not_reflecting_in_aal-kdeb
head
dc3e55b62ec8effcde6c2d0a4bd398e7e1b0db5b
merged
8 months ago by Fun Services, Xavier Bol (xbo)
odoo/odoo
16.0 #194300
17.0 #194837
saas-17.2 #194960
saas-17.4 #195049
18.0 #195071
saas-18.1 #195546
saas-18.2
saas-18.3
saas-18.4
19.0
master #195562

[FIX] project_purchase: include negative bills in project profitability

Issue:

  • The negative values in Vendor Bills are not being reflected in the Analytic Account linked to a project.
  • the negative value does not reduce the project’s total cost in the Analytic Report cost calculations.

Steps to reproduce:

1- Create a project and set an analytic account or use the "Renovations" project.
2- Create a vendor bill.
3- On the VB add two lines one with a positive Price and the other with a negative Price.
4- on Analytic of each line set the project to Renovations or the project you created.
5- Validate the vendor bill.
6- Go to the project app and click on the 3 dots of the project you choose and click on Project Updates.
7- Notice the total cost of the project is not reflecting the negative value of the vendor bill.

Solution:

  • The issue is caused by the condition ('price_subtotal', '>', 0) in the query for account.move.line.
  • Removing this condition ensures both positive and negative price_subtotal values are included.

opw-4416931

I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr