目前,您可以将OpenERP的返回值设置为以下值,以获取要关闭的当前表单:
return {'type':'ir.actions.act_window_close' }
是否有可以打开另一个表单的返回值?例如,在产品窗体中,按钮可以调用销售窗体或向导窗体。
发布于 2012-09-28 13:47:48
以下是一个对您有帮助的function.Maybe示例
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
}
发布于 2013-09-05 05:18:51
有一个函数可以为您提供给定xml_id的act_window。
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
https://stackoverflow.com/questions/12634031
复制相似问题