odoo/odoo#197009

Created by fw-bot
Merged at 1bd309cec15ab9b0f63e6870397cf7edbc1fa0b1

Statuses:

label
odoo-dev:17.0-16.0-opw-4492217-manual-valuation-weird-entries-double-etvi-414559-fw
head
55a882a8728939072424142a298fac0e3aedcac6
merged
7 months ago by Vincent Ethan
odoo/odoo
16.0 #196786
17.0 #197009
saas-17.4 #197879
18.0 #197902
saas-18.1 #199884
saas-18.2 #200125
saas-18.3
saas-18.4
19.0
master #200136

[FW][FIX] purchase_stock: respect manual valuation

Current behavior:
Invoicing some product at a price unit different from that at reception (with the product having manual valuation and non-standard costing) will create pdiff account move lines on the invoice.

Expected behavior:
With manual valuation, there should not be pdiff AMLs.

Steps to reproduce:
1. Create a product with average costing and manual valuation

  1. Receive 10 units @ $100 to establish some std price

  2. Consume the 10 product qty (scrap, sale, ...)

  3. Create the invoice on the purchase order

  4. Change the price unit on the bill to $120 per product -> post

  5. In the journal items tab on the invoice, see the pdiff AMLs

Cause of the issue:
No consideration for valuation when creating the AMLs for pdiff.

Fix:
Check that valuation is not manual prior to creating the AMLs.

opw-4492217

Forward-Port-Of: #196786