Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
  • How to override field_view_get field in orm model in openerp

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 407
    Comment on it

    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

 0 Comment(s)

Sign In

Sign up using

Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: