OCA / purchase-workflow

Odoo Purchases, Workflow and Organization
GNU Affero General Public License v3.0
197 stars 764 forks source link

Discount not applied on Kit with the module MRP when the in-transfer is confirmated #2335

Open JavierYataco opened 2 months ago

JavierYataco commented 2 months ago

purchase_discount

Describe the bug

When we create a PO with discount and the product in the line of the PO has a Bill of Material(in the manufacturing module), the discount is applied on the PO, but when I want to confirm the transfer in the inventory module, this confirmation has a bug because the valorization its applied with the full price but not with the discount.

To Reproduce

Affected versions: Version 16

Steps to reproduce the behavior:

  1. Create a Bill of Material of any product, this BoM has a Cost Share(used to calculate the material's prices in function of the kit when we use AVCO and the automatic valorization in product category configuration)
  2. Create a PO with the kit product and confirm.
  3. Go to Receive Products and validate this transfer.
  4. When validate the transfer we notice that valorization has taked the full price of the kit product but not the discount price.

Expected behavior I think that the expected behavior has to be that the valorization should take the discount price, for example if the product was purchased in 100$ and with discount of 50% its final cost is 50$, then the cost of the components of the kits has to be in function of the 50$.