-
- Downloads
[FIX] stock:use manufacture security LT if manufacture is selected in RR
Steps to reproduce the bug:
- Assume the current date is August 1, 2023.
- Go to general settings:
- set purchase security lead time: 20 days
- set manufacturing security lead time: 25 days
- Create a storable product “P1”
- Routes: Manufacture + buy
- Manufacture lead time: 1 day
- Create an order point:
- preferred route: Manufacture
- Quantity to order: 5
- Click on “Order once”
Problem:
A manufacturing order is created, but the "Scheduled Date" is incorrect.
Instead of being set to August 1, 2023, it shows August 7th.
The issue occurs because initially, we calculate the `Lead days date`
as follows:
Today's date (August 1st) + manufacturing security lead time (25)
+ Manufacturing Lead Time (1) = August 27th.
However, we use the purchase security lead time (20) instead of the
manufacturing so 27 - 20 = August 7th
To determine the exact date, we call the function
`_get_date_with_security_lead_days`. In which we try to get the
appropriate rule to use. However, in this case, the preferred route
of the orderpoint is not passed as a parameter to the function.
Therefore, we use the first rule of the first route ("buy"), and we end
up using its security lead time.
opw-3439546
closes odoo/odoo#130431
Signed-off-by:
Arnold Moyaux (arm) <arm@odoo.com>
Showing
- addons/purchase_mrp/tests/test_purchase_mrp_flow.py 40 additions, 0 deletionsaddons/purchase_mrp/tests/test_purchase_mrp_flow.py
- addons/stock/models/product.py 2 additions, 2 deletionsaddons/stock/models/product.py
- addons/stock/models/stock_move.py 1 addition, 1 deletionaddons/stock/models/stock_move.py
- addons/stock/models/stock_orderpoint.py 1 addition, 1 deletionaddons/stock/models/stock_orderpoint.py
Loading
Please register or sign in to comment