Odoo Help


why res.users in more modules ? [Closed]

on 4/14/13, 3:23 PM 3,423 views

The Question has been closed

on 04/22/2013 04:54:31

in openerp 7 i checked some modules and saw that res_users class exists in more modules.ex : survey.py... what is the usage of that.they call it by same name

class res_users(osv.osv):
    _inherit = "res.users"
    _name = "res.users"
    _columns = {
        'survey_id': fields.many2many('survey', 'survey_users_rel', 'uid', 'sid', 'Groups'),


I need to create my own user module.then can i use like above.? I need to save records in res_users table because seems openerp match username and password from that table.please advice me to implement this requirement.



Serpent Consulting Services Pvt. Ltd.

--Serpent Consulting Services Pvt. Ltd.--
Serpent Consulting Services Pvt. Ltd.
| 6 6 8
Gandhinagar, India
--Serpent Consulting Services Pvt. Ltd.--

Serpent Consulting Services Pvt. Ltd. Your Odoo/OpenERP Solution, just an email away!

Serpent Consulting Services Pvt. Ltd.
On 4/15/13, 3:55 AM


The main class is in addons/base/res/res_users.py. In all the other models we just inherit the main class.

_inherit: When we want to do changes in existing model we use _inherit.

For example, Here in survey.py the res.users model is inherited and the new field called 'survey_id' is added in the model. Here,all the other fields in res.users model is as it is, only the one new field is added.

Que: I need to create my own user module.then can i use like above.? Yes, You can create your own module.

Thank you.




| 5 4 7
Baarn, Netherlands
On 4/15/13, 6:32 AM

As others stated before, the reason res.partner (or res_partner) exists in more than one module, is that each module used the table/object res.partner, and adds something to the table and/or adds methods to the object and/or changes the behaviour of existing methods.

As you state correctly, you can use the example code for your own changes.

One thing to think of, is what modules do you use, because if you redefine a method from another module, and that module is installed AFTER your module, your changes are gone! So in the __openerp__.py of your module, you have to specify on which module(s) your module depends.

thanks patrick.issue now sorted :-)

on 4/15/13, 6:59 AM
Wolfgang Taferner
On 4/15/13, 3:42 AM

Take a look here or here

thanks Wolfgang :-) its really help me

on 4/15/13, 6:53 AM
Turkesh Patel (tpa)
On 4/15/13, 5:15 AM

if you are asking for the name given in _name then there is no need to give same name in "_name" when you inherit any class.

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)


Asked: 4/14/13, 3:23 PM
Seen: 3423 times
Last updated: 3/16/15, 8:10 AM