Manufacturing order created from procurement is automatically confirmed

Bug #1234004 reported by Ronald Portier (Therp)
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Incomplete
Undecided
Unassigned
OpenERP Community Backports (Addons)
Status tracked in 7.0
7.0
New
Medium
OpenERP Community Backports

Bug Description

I have a product with attributes:

- type of product: stockable
- procurement method: make to order
- supply method: produce

I have multiple locations where I can produce the product. For this routings have been created.

When I confirm a Sale Order (SO), and run the scheduler, a Manufacturing Order (MO) is created which is correct.

However the MO is immediately confirmed.

This makes it impossible to change:
- The scheduled date
- The bill of materials (I might have alternative BOM's)
- The routing (this is the problem I encountered)
- Locations for raw materials or finished products

I can understand that this works for simple setups, where each product has only one possible routing, scheduled dates never change etc.

But there really has to be an option to have the MO created in draft state. Just like Purchase Orders (PO) are created in draft state when supply method is 'buy'.

Unfortunately this is not easy to change by creating an extra module, as the confirmation is done right at the end of the function that creates the MO at the first place.

It is the line in python file mrp/procurement.py, function make_mo:

wf_service.trg_validate(uid, 'mrp.production', produce_id, 'button_confirm', cr)

Calling this workflow should IMHO be dependent on a configuration option wether to automatically confirm MO's or not.

There are to many use-cases where automatic confirmation is absolutely undesirable.

Putting this change in an extra module would requiring replacing the whole make_mo function with a modified copy, which I think is a very bad idea for maintainability.

Related branches

description: updated
Revision history for this message
Amit Parik (amit-parik) wrote :

Hello Ronald,

This is the desired behavior for the business flow because when we confirm the sale order it will generate the procurement and when you run the procurement it will create and confirm the respective MO. because we have to manage our virtual stock as well.

Let me explain the virtual stock here.
Virtual stock :- Incoming stock move (which is on draft and waiting state) - Outgoing stock move(which is on draft and waiting state) + real stock

So when we run the scheduler, our plan is to manage the virtual stock 0.0. So when manufacturing order confirms it will creates the stock move from production to stock location, So our virtual stock satisfy and this is clearly an intensional behavior not the bug. Here we are not only take the case as "Make to Order" because consider the same behavior for the "Make to Stock" .
Once MO confirmed then it will creates the stock move and virtual stock satisfied. Take the example for the make to stock and automated order point , on this condition (for automated order point) procurement order will be created based on the virtual stock. If MO will not confirmed > stock move won't created then run the scheduler again and again then it will create a manufacturing order more times which doesn't make sense;-)

You have also ask about the purchase order behavior for this, also you can see when draft purchase order created when you run the procurement/scheduler as well as at the same time virtual stock also will updated without the stock move. So that will be fine here . And we have done much of the conversation on lp:921866, would you please check it this will help.

*About your issue which is for the multiple BOM for the same product*
We can define the BOM property on the Bill of material , when you have created the BoM. So this property field is also linked on sale order . You can see on sale order line on at there you can add the BOM property, So If you have multiple BoM for the same product , you can enter the BoM property for all the BoMS and select the BoM property on sale order line. Based on this BoM property relavent BoM will be link with the Manufacturing order.

Hope this will help.

Let me know your point of view.

Thank you!

Changed in openobject-addons:
status: New → Incomplete
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.