[FIX] sale_purchase_stock: correct PO deadline date
steps to reproduce it:
1. Create a storable product, add a Purchase vendor with
start date = 20/6/2022 and delay = 56
2. Create another storable product, add the same Purchase vendor with
start date = 11/01/2023 and delay = 21
3. For both products, add Routes "MTO".
4. Create a SO with those 2 products, and confirm it
5. As you can see, the price of the first product is correctly set
but not the second product
BUG:
This is due of "Order Deadline" (date_order) being set to an old date,
which is before the second product date_order.
FIX:
set max PO date as today
opw-3167094
closes odoo/odoo#124448
Related: odoo/enterprise#44391
Signed-off-by:
William Henrotin (whe) <whe@odoo.com>
Showing
- addons/purchase_stock/models/stock_rule.py 5 additions, 4 deletionsaddons/purchase_stock/models/stock_rule.py
- addons/purchase_stock/tests/test_purchase_lead_time.py 1 addition, 1 deletionaddons/purchase_stock/tests/test_purchase_lead_time.py
- addons/sale_purchase_stock/tests/__init__.py 1 addition, 0 deletionsaddons/sale_purchase_stock/tests/__init__.py
- addons/sale_purchase_stock/tests/test_lead_time.py 67 additions, 0 deletionsaddons/sale_purchase_stock/tests/test_lead_time.py
Loading