over 9 years ago
In openerp first override the orm model and add fields field_view_get in orm model then return the Dictionary of Fields, arch and toolbar in orm model.
you can use this function as given below.
- def fields_view_get(self, cr, user, view_id=None, view_type='form', context=None,\
- toolbar=False, submenu=False):
- res = {}
- res = super(board_board, self).fields_view_get(cr, user, view_id, view_type,\
- context, toolbar=toolbar, submenu=submenu)
- vids = self.pool.get('ir.ui.view.custom').search(cr, user,\
- [('user_id', '=', user), ('ref_id' ,'=', view_id)])
- if vids:
- view_id = vids[0]
- arch = self.pool.get('ir.ui.view.custom').browse(cr, user, view_id, context=context)
- res['custom_view_id'] = view_id
- res['arch'] = arch.arch
- res['arch'] = self._arch_preprocessing(cr, user, res['arch'], context=context)
- res['toolbar'] = {'print': [], 'action': [], 'relate': []}
- return res
def fields_view_get(self, cr, user, view_id=None, view_type='form', context=None,\ toolbar=False, submenu=False): res = {} res = super(board_board, self).fields_view_get(cr, user, view_id, view_type,\ context, toolbar=toolbar, submenu=submenu) vids = self.pool.get('ir.ui.view.custom').search(cr, user,\ [('user_id', '=', user), ('ref_id' ,'=', view_id)]) if vids: view_id = vids[0] arch = self.pool.get('ir.ui.view.custom').browse(cr, user, view_id, context=context) res['custom_view_id'] = view_id res['arch'] = arch.arch res['arch'] = self._arch_preprocessing(cr, user, res['arch'], context=context) res['toolbar'] = {'print': [], 'action': [], 'relate': []} return res
0 Comment(s)