odoo/odoo#195562

Created by fw-bot
Merged at e84e13bede52bce507cb7b789447937b56c0f2f7

Statuses:

label
odoo-dev:master-16.0-OPW-4416931-project_purchase_account_negative_entry_not_reflecting_in_aal-kdeb-zRzS-fw
head
4c35ea78959b976e3912173450903e54baf98a72
merged
8 months ago by Bugfix, Kawtar Drissi El Bouzaidi (kdeb)
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

[FW][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

Forward-Port-Of: #195071
Forward-Port-Of: #194300