Odoo Help


Automatically move manufacturing order through workflow.

on 12/18/14, 2:51 PM 842 views

I would like to write a bit of Python code in a Server Action that will finish production on a manufacturing order. The action should update all the necessary fields and the inventory -- just as if the user pressed the 'Produce' button in the manufacturing orders UI.

Is there a way to achieve the same result as pressing the 'Produce' button, but through Python code? 


Ludo - Neobis

--Ludo - Neobis--
| 2 2 5
Hoogvliet, Netherlands
--Ludo - Neobis--


Ludo - Neobis
On 12/19/14, 3:48 AM

There is, you just need to find the correct methods and workflow action for this. Look up the workflow (XML file) for the MRP module and see what states are called. 

If you are using OpenERP 7, it would be something like this:

netsvc.LocalService("workflow").trg_trigger(uid, 'account.move.line', id, cr)

Don't know if this is the same for Odoo 8.0 and up. Didn't check that one yet.


Turn on your developer mode to see what menu's and buttons a user would normally call, and simulate the process in code.

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

2 follower(s)


Asked: 12/18/14, 2:51 PM
Seen: 842 times
Last updated: 3/16/15, 8:10 AM