首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >方法返回值以调用OpenERP中的另一个窗体

方法返回值以调用OpenERP中的另一个窗体
EN

Stack Overflow用户
提问于 2012-09-28 13:23:24
回答 2查看 6.9K关注 0票数 3

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

代码语言:javascript
运行
复制
return {'type':'ir.actions.act_window_close' }

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

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2012-09-28 13:47:48

以下是一个对您有帮助的function.Maybe示例

代码语言:javascript
运行
复制
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 
        }
票数 7
EN

Stack Overflow用户

发布于 2013-09-05 05:18:51

有一个函数可以为您提供给定xml_id的act_window。

代码语言:javascript
运行
复制
def open_popup(self, cr, uid, ids, context=None):
    if move.parent_production_id:
        win_obj = self.pool.get('ir.actions.act_window')
        res = win_obj.for_xml_id(cr, uid, 'module_name', 'id_specified_for_the_view', context)
        return res
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/12634031

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档