I have inserted a button as a cell in a tree view for my model. When the button is clicked it is suppose to pop up a form to edit the current record, the record is in the same row where the button is.
This is the code to handle the clicking of the button:
-----------------------------
def open_details(self, cr, uid, ids, context=None):
view = {
'name': _('Details'),
'view_type': 'form',
'view_mode': 'form',
'res_model': 'my.model',
'view_id': False,
'type': 'ir.actions.act_window',
'target': 'new',
'readonly': True,
'res_id': ids[0],
}
return view
--------------------------------
It is not working. The form is shown but no data is loaded, and there isn´t either save or cancel button.
What is wrong in this code?