Minimum stock rule does not generate a purchase order
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Addons (MOVED TO GITHUB) |
Invalid
|
Undecided
|
JMA(Open ERP) |
Bug Description
A similar problem has already been discussed in #599300; a solution has been suggested, but works only if the minimum stock rule has a min quantity of 0.
There is still a problem if the min quantity of the stock rule is not equal to 0:
- Create a stockable product PROD1, with procure method = MTS, suppy method = buy, a minimum stock rule with min quantity = 10 and max quantity = 20, and no stock
- Sell 15 PROD1
- Run the "Compute Stock Minimum Rules Only" scheduler and check the "Automatic orderpoint" box.
2 purchase orders have been created : 1 for 15 PROD1 (origin=SCHEDULER) and 1 for 20 PROD1 (origine OP/00002). That's OK. PROD1 has a virtual stock of 20.
- Now sell for example 16 PROD1
- Run again the "Compute Stock Minimum Rules Only" scheduler and check the "Automatic orderpoint" box.
NO PURCHASE ORDER IS CREATED???
Virtual stock for PROD1 is 4, less than the minimum stock rule, and no purchase order is generated.
Changed in openobject-addons: | |
assignee: | nobody → JMA(Open ERP) (jma-openerp) |
Changed in openobject-addons: | |
milestone: | none → 5.0.15 |
Hello Jean-Luc WEYL,
I have thoroughly gone through your posted scenario.
I also agree that no purchase order is created for the above stated scenario.
The 'Compute Stock Minimum Rules Scheduler' wizard takes into consideration the 'Virtual Stock' of the product that you are dealing with based on the Min & Max quantity assigned prior to it using 'Minimum Stock Rules'.
So, when you have the Virtual Stock less than the Min. qty assigned the purchase order wont be generated using the wizard.
The reason is , in schedulers.py we have the following condition:
if prods < op.product_min_qty:
So the PO will not be created and this seems to be a very generic behaviour.
However, you can use the other scheduler and the PO will be created for it.
I hope this makes things clear.
Thanks.