Skip to content
Snippets Groups Projects
Commit fadb7087 authored by Adrien Widart (awt)'s avatar Adrien Widart (awt)
Browse files

[FIX] purchase_stock: update RR's qty_to_order on POL's qty change


When a RR updates the qty of a POL, the qty to order of that RR will
be incorrect

To reproduce the issue:
1. Create a product
   - Storable
   - With a vendor
2. Create a RR:
   - Min 0
   - Max 0
   - Factor 1
3. Confirm a delivery with 1 x P
   - It should create a PO
4. Confirm a second delivery with 1 x P
    - The POL of the PO should be updated
5. Open the Replenishment page

Error: The qty to order of the product is 1 while it should be 0

`qty_to_order` is a computed field and one of the `depends` is the POL
related to the product. This explains why, after step 3, everything
is ok: the compute is triggered (because of the new POL) and the qty
to order becomes 0. However, step 4, the POL qty is updated -> it
does not concern any `depends` -> the compute is not triggered,
hence the error

OPW-3292297

closes odoo/odoo#127554

Signed-off-by: default avatarWilliam Henrotin (whe) <whe@odoo.com>
parent ce02b27a
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment