This question has been flagged
1 Reply
1977 Views

I have made one custom module to make association between user and vendor. When i install this module in odoo-8, the signup form not  showing "your email" field information, it is blank. I unable to enter email information there, because it is readonly field.

These two are my relations between user and vendor:

class res_partner(osv.osv):
    _inherit="res.partner"
    _columns = {
        'user_ids':fields.one2many('res.users','res_partner_id','Users', readonly=True),
    }
class res_user(osv.osv):
    
    _inherit="res.users"
    _columns = {
        'res_partner_id':fields.many2one('res.partner','Partner'),
    }

Please can any one help me?

Avatar
Discard
Best Answer

Here you have a small understandig probelm.. res_partner model, already has boolean 'is_user', and res_users already inherits res_partner, and extends it with user tech data , and is m2o related to partner_id No need for extra m2o-o2m relation (specialy not o2m partner-> user!) The only problem is, when you create a new user , it will automaticly create NEW partner. What you need to do, is make a wizard wich will allow to select existing partner before createing actual user, and create associated user for that partner... So on res_partner that record will have company_id of his real company , and related res_users record will have comapny_id of company that he is user of... Hope you got the idea.. this is not simple to understand... Try to examine db data for more info, and do some tests...

Avatar
Discard
Author

Thank you Bole. Working fine. I have removed my custom relation between user and partner. Using existing user and partner relation.

Very good catch Bole! Upvoted :)