Search code examples
odooodoo-8odoo-9

How to get name fields exist of model in Odoo(OpenERP)?


Please, help me. I have a model 'res.users'. I want to get name fields exist(declared) in my model. What should I do? Thanks.


Solution

  • You question is not much clear what you want to do with that, but if you want to get the name of the model then you should go for below answer.

    It's good if you can elaborate your question with output or few more details.

    you should try following,

    model = self.env['ir.model'].search([('model','=','res.users')])
    if model:
        print model.name
    

    However you can access all the fields of that model. There is field_id (one2many) field is there in ir.model.