I wanted to know that is this possible in OpenERP-7 to call a form through a button in read-only mode. Like the form is editable through some buttons but I want to put some restrictions through a specific button . I want that when a user clicks the button the form opens in read-only mode and user cannot create/edit/delete any of the records. I tried to use this in my .py file:
def views(self,cr,uid,ids,context):
for id in ids:
deg_obj=self.pool.get('deg.form').browse(cr,uid,id)
my_id=int(deg_obj.my_products)
ss= int(deg_obj.categ_temp2)
domain = [('categ_id','=',ss)]
return {
'type': 'ir.actions.act_window',
'name': _('Product'),
'res_model': 'product.product',
'view_type': 'form',
'view_mode': 'tree,form',
'target': 'current',
'domain': domain,
'store':False,
'create':False,
'edit':False
}
and this is my xml code:
<button name="views" string="VIEW PRODUCT" type="object" />
But its not working with this. I dont know if I have to put any attributes in the xml code or what. Because The form will be in view mode only with this button call. Any help or guidance will be appreciated. Thanks all