Technical Name | many2one_list_knk |
License | OPL-1 |
Open List/Tree View From Many2one
In this Open List/Tree View From Many2one module user click of many2one field it will open list view.
- To open tree view on click of Many2one field follow this steps
1. Inherit Model in your module
Ex:
class ProductProduct(models.Model):
_inherit = 'product.product'
2. Override "get_formview_action" method in that model
Ex:
class ProductProduct(models.Model):
_inherit = 'product.product'
def get_formview_action(self, access_uid=None):
return {
'name': self.name,
'type': 'ir.actions.act_window',
'res_model': self._name,
'view_type': 'list',
'view_mode': 'list',
'views': [(False, 'list')],
'context': dict(self._context),
'domain': [('id', 'in', self.ids)],
}
-
Added Module
OPL-1
Comment on this module. Please Login