I’m building a openerp customer module that in tree view, there is a button for each entry, when pressed, an act_window action will be triggered and open a new pops-up window, but at the same time, the main gtk client disappeared (only the pops-up remains). Also I have set the ‘target’ to ‘new’, but still the same. Any ideas?
client: gtk-6.0.3 on windows
server: 6.0.2 on debian 2.6.32
the xml looks like:
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Field Schema">
<field name="field_name" />
<field name="field_type" />
<button name="edit" type="object" string="View and Edit" icon="gtk-go-forward" />
</tree>
</field>
and the edit function to trigger looks like:
def edit(self, cr, uid, ids, context=None):
obj_name = some_fn_dynamic_get_obj_name_from_ids(ids)
obj = self.pool.get(obj_name)
if not obj:
raise osv.except_osv('not supported')
res_id = obj.create(....)
...
return {
'type': 'ir.actions.act_window',
'name': 'View and Edit',
'view_mode': 'form',
'view_type': 'form',
'res_model': obj_name,
'res_id': res_id,
'target': 'new',
'context': context,
}
Updated: after debug into the client’s source, i finally found that: i make a typo: nodestory where the correct one should be nodestroy
return {
'type': 'ir.actions.act_window',
...
'context': context,
'nodestroy': True,
}
T_T
I can’t see anything obviously wrong. The
targetattribute is discussed in the developer book. The only thing I can suggest would be to look for examples in the source code that use thetargetattribute and see how they differ from yours.