Hello,
Hint : By default, If no view specified at action return time (which you have did in your example), then OpenERP creates itself tree view and return only "Name" column.
In Order to achieve your purpose, you need to find the tree view and form view and add those into return dictionary.
For example see below code, ( See Bold Lines & you will understand what I am trying to say )
def button_click_method(self, cr, uid, ids, context=None):
self_obj = self.browse(cr, uid, ids, context=context)[0]
product_ids = []
if self_obj.product_ids:
product_ids = [ int(x) for x in self_obj.product_ids.split(', ')]
data_obj = self.pool.get('ir.model.data')
data_id = data_obj._get_id(cr, uid, 'product', 'stone_tree_view_ept')
view_id = False
if data_id:
view_id = data_obj.browse(cr, uid, data_id, context=context).res_id
form_data_id = data_obj._get_id(cr, uid, 'product', 'stone_form_view_ept')
if form_data_id:
form_view_id = data_obj.browse(cr, uid, form_data_id, context=context).res_id
context.update({'active_ids': [],'no_complete_name':1})
return {
'name': _('Stones'),
'view_type': 'form',
'res_model': 'product.product',
'view_id': False,
'domain':"[('id', 'in',%s)]" %(product_ids),
'context': context,
'views': [(view_id, 'tree'), (form_view_id, 'form')],
'type': 'ir.actions.act_window',
'target': 'current',
'nodestroy': True
}
If you have not created Tree and Form view then please create them first.
Hope this answer will help you,