Odoo Help

Welcome!

This community 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.

1

How to display an object form from a function called from a workflow

By
Aldennis
on 2/19/13, 4:05 AM 1,346 views

I would like to ask how to return an object form using a function that would be called on the workflow. Here is my code

class mrp_production(osv.osv_memory): _inherit = 'mrp.production'

def confirm_move(self, cr, uid, ids, context=None):
    obj_model = self.pool.get('ir.model.data')
    model_data_ids = obj_model.search(cr,uid,[('model','=','ir.ui.view'),('name','=','stock.move.tree')])
    return {
        'name': 'Stock Move',
        'view_type': 'form',
        'view_mode': 'tree',
        'res_model': 'stock.move',
        'view_id' : model_data_ids,
        'search_view_id' : 'stock.view_move_search',
        'context': {'search_default_ready':1},
        'type': 'ir.actions.act_window',
        'nodestroy': True,
        'target': 'new',
    }

mrp_production()

Whenever I call this function on the Workflow, no window pops out. I would like the Stock Moves action window to pop up after clicking the Confirm button when a product has been produced in the Manufacturing Orders

Any idea what I'm, doing wrong?

use action type as wizard instead of workflow if you still need using workflow trigger put your full code here (workflow,etc..)

senthil
on 3/13/13, 3:25 AM
0
Praveen Kumar
On 7/10/13, 6:30 AM

You Have to also return 'res_id' also. which You didn't Mentioned.

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 community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

Asked: 2/19/13, 4:05 AM
Seen: 1346 times
Last updated: 3/16/15, 8:10 AM