Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0] purchase_landed_cost: Wrong value in "standard_price_old" field #2387

Open
greciosd opened this issue Aug 9, 2024 · 0 comments
Open
Labels

Comments

@greciosd
Copy link

greciosd commented Aug 9, 2024

Module

purchase_landed_cost

Describe the bug

The value of the "standard_price_old" field in the cost distribution varies depending on the "purchase_method" field of the product.

To Reproduce

Affected versions: 16

Steps to reproduce the behavior:

  1. Create a product with "purchase_method" field set to "purchase" option:

image

  1. Costing method set to "FIFO":

image

  1. Create a purchase order with this product and a 45% discount:

image

  1. Confirm order, receive product and create bill.

  2. Create a purchase cost distribution and import incoming shipment. Previous cost field ("standard_price_old") value is the discounted amount:

image

  1. Repeat all the previous steps, but set the product's "purchase_method" field to "receive":

image

  1. In this case, the value of the previous cost field in the cost distribution is:

image

Expected behavior
I think the correct value should be 3194'40 (step 7) regardless of the "purchase_method" field setting.

Maybe the problem is that the function "_compute_standard_price_old" of "purchase.cost.distribution.line", is calling the function "_get_price_unit" of "stock.move". In the module "purchase_stock", this function has a condition that depends on the field "purchase_method".

image

As I said before, I think that when performing a cost distribution, the values ​​should not depend on "purchase_method".

Is this correct or am I wrong?

Thanks in advance.

@greciosd greciosd added the bug label Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant