Minimum stock rules does not generate a purchase order

Bug #599300 reported by Jean-Luc WEYL
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Invalid
Undecided
Unassigned

Bug Description

If you have a stockable product PROD1, with procure method = MTS, suppy method = buy and a minimum stock rule with min and max quantity set to 0, and if you have no stock of that product, then, if you sell 10 PROD1, the minimum stock rule scheduler will generate a purchase order for 10 PROD1.
If you sell in addition another 10 PROD1, the scheduler will never generate any other purchase order, as long as the first purchase order has not been completed.
The scheduler should be able to see that a new sale order has been issued, and that it should create for that a new purchase order.

Revision history for this message
JMA(Open ERP) (jma-openerp) wrote :

Hello Jean-Luc WEYL,

It seems you having some configuration issues.
procure method = ' MTS' supply method = 'buy' --> Production Order
procure method = 'MTO' supply method = 'buy' --> Purchase Order

In order to generate the purchase order as
I created a product with type procure method = 'MTO' & supply method = 'buy' and followed the steps as posted above. The behaviour works pretty normal.
So, when you sell a additional '10 PROD1' and compute through 'Scheduler' it will obviously create a 'Purchase Order' for it.

I hope this helps, Kindly re-check with the configuration.

Thank you.

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Hello Jean-Luc WEYL,

As said by JMA(OpenERP) ,it looks like a problem with configuration.
We would like to request you to recheck with the configuration said by JMA.

More queries invited.
Thanks.

Changed in openobject-addons:
milestone: none → 5.0.13
status: New → Invalid
Revision history for this message
Jean-Luc WEYL (jean-luc-weyl) wrote :

What you are doing works... but you are using the "Compute Procurements Only" scheduler, and we are talking here about the "Compute Stock Minimum Rules Only" scheduler. The problem is in the second scheduler, and not in the first one.
Your suggestion cannot be used as a workaround for our problem, and we do not have a configuration issue.
The purpose is not to create a purchase order based only on sale orders (you sell 1 so you buy 1), but to use the minimum stock rules, andif you do that, you have the problem described in that report.

Changed in openobject-addons:
status: Invalid → Confirmed
Revision history for this message
JMA(Open ERP) (jma-openerp) wrote :

Hello Jean-Luc WEYL,

I followed your steps just as you have posted.
The minimum stock rules have been set to '0'. So when you create a purchase order you wont be able to as you have no stock therein, you need to run the scheduler prior to that.
So, when you add another 10 qty of the same product the minimum stock rules is '0' and not '10'.
So again you need to run the scheduler.

In respect to your latter post that the problem is in the second scheduler. I tried it with the "Compute Minimum Stock Rules" scheduler and the behaviour is normal.

However, if you are not able to create a purchase order you can create procurement manually and then run the schedulers.

I hope I have understood you properly?

I hope this helps.
Thanks.

Revision history for this message
Jean-Luc WEYL (jean-luc-weyl) wrote :

The problem that we describe comes from the following code:
In mrp/schedulers.py, class mrp_procurement, function _procure_order_point_confirm
you have the following lines:

            for op in orderpoint_obj.browse(cr, uid, ids):
                if op.procurement_id and op.procurement_id.purchase_id and op.procurement_id.purchase_id.state in ('draft', 'confirmed'):
                    continue

So when the "Minimum Stock Rules " scheduler is executed, IF you have an already existing purchase order which is in
state 'draft' or 'confirmed', THEN no new purchase order will be created, even if you have (manually or not) created a procurement.

So we have a newly created procurement, but no additionnal purchase order.

Revision history for this message
JMA(Open ERP) (jma-openerp) wrote :

Hello Jean-Luc WEYL,

The code which you are talking about is only for, not allowing to generate a purchase order(second time) which has already been computed once using the scheduler.

Regarding the problem of second scheduler, Please select the "Automatic Orderpoint" option on the 'Compute All Schedulers Wizard' so you will have a purchase order for it.

Kindly check again and notify us.
I hope this is clear.

Thank you.

Revision history for this message
Jean-Luc WEYL (jean-luc-weyl) wrote :

Right, checking the "Automatic Orderpoint" box generates a new purchase order.
Thanx for your help

Changed in openobject-addons:
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.