方法的返回值以调用OpenERP中的另一种形式 [英] Method return value to call another form in OpenERP

查看:69
本文介绍了方法的返回值以调用OpenERP中的另一种形式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当前,您可以将OpenERP的值设置为以下值,以获取要关闭的当前表单:

Currently, you can set to return value of an OpenERP to the following, to get the current form to be closed:

return {'type':'ir.actions.act_window_close' }

是否有一个返回值可以打开另一个表单? 例如,在产品"表单中,按钮可以调用销售表单或向导表单.

Is there a return value that would open another form instead? For example, in the Product form, buttons can call a sales form or a wizard form.

推荐答案

以下是示例功能.可能对您有帮助

Following is an example function.Maybe helpful for you

def open_popup(self, cr, uid, ids, context=None):
    mod_obj = self.pool.get('ir.model.data')
    if move.parent_production_id:
        res = mod_obj.get_object_reference(cr, uid, 'module_name', 'id_specified_for_the_view')
        return {
            'name': 'Provide your popup window name',
            'view_type': 'form',
            'view_mode': 'form',
            'view_id': [res and res[1] or False],
            'res_model': 'your.popup.model.name',
            'context': "{}",
            'type': 'ir.actions.act_window',
            'nodestroy': True,
            'target': 'new',
            'res_id': record_id  or False,##please replace record_id and provide the id of the record to be opened 
        }

这篇关于方法的返回值以调用OpenERP中的另一种形式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆