This question has been flagged
3 Replies
16547 Views

From the Odoo 13 documentation: 

The Make to Order route will trigger a procurement (purchase order or manufacturing order) with the necessary quantity to fulfill a product request (coming from a sale order or a manufacturing order). The system will not check the quantity on hand for the corresponding product.

I'm trying to create a module that changes the behavior of the Make to Order (now appears to be called "Replenish on Order (MTO)") route so that it checks stock levels before doing any procurement, and only replenishes what is necessary to fulfill the product request that triggers the route. I've been unable to find where this operation is done, so I'm not sure how to go about this. 

I'd appreciate it a lot if anyone can point me in the right direction!

Avatar
Discard
Best Answer

That documentation seems not to have been updated.  In Odoo 13 the stock available is checked, though it's possible to alter the behaviour by changing the Supply Method on the Rule:  

  1. “Take from Stock” isn’t correct for an MTO rule.

  2. “Trigger another rule” is the way it worked in Odoo 12 and earlier, meaning that an RFQ will always be created (or demand added to an existing RFQ), regardless of the stock available.

  3. “Take from Stock, if unavailable, trigger another rule” is the default in Odoo 13 and checks the stock availability before creating an RFQ

More information

Avatar
Discard
Author

Under the Replenish on Order (MTO) route, there are three rules: Stock -> Partner Locations/Customers, Stock -> Virtual Locations/Production, and Stock -> Partner Locations/Subcontracting Location. By default, the rules for production and subcontracting are both set to "Trigger Another Rule," and changing either to "Take From Stock, if unavailable, Trigger Another Rule" will simply break the rule (nothing at all will be replenished at the Production/Subcontracting stage). Notably, the Resupply Subcontractor on Order route's only rule is set to "Trigger Another Rule" by default as well, and it exhibits the same behavior as the two aforementioned rules (completely breaking the route if this setting is changed).

I didn't suggest changing that. I explained that Odoo has changed the Supply Method on the first of the three Rules, and it can be changed back to how it was in Odoo 12.

Best Answer

The MTO route will check stock first. If there's enough, the transfer will be fulfilled with stock. If not, the entire quantity goes to procurement.

I've been able to configure an hybrid, which seems to be what you're looking for.

First, uncheck the MTO route from the product. Then, create a reordering rule with 0 min, 0 max. And that's it. This seems useless but it at least tells Odoo to order this product automatically.

So when a transfer is initiated from stock, all the stock is pulled first and the remaining creates a need that is then fulfilled by the reordering rule.

Avatar
Discard

Hello Jérôme, This is the way I want this to be done, but I still need mto to keep the link between the MO,PO and the sales order. If I use the standard replenishment, the connection between The MO, PO and the SO is lost. Is there a way to keep the connection and do use the replenishment?

Not that I'm aware of, unfortunately. Not without a custom module.

This answer was for Odoo 13 though. Things have changed quite a bit in this area of Odoo in 14.0 and 15.0.

Best Answer

It is in product cart -> Inventory tab -> Routes section

Thanks

Avatar
Discard