Odoo Help

0

Automatically move manufacturing order through workflow.

By
Owner
on 12/18/14, 2:51 PM 647 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? 

0

Ludo - Neobis

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

Developer

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.

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

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.

Register

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)

Stats

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