Odoo Help


Creating A User in res_partner with python controller in website signup

on 8/20/16, 12:28 AM 1,179 views
    env = request.env(context=dict(request.env.context, show_address=True, no_tag_br=True))
env['res.partner'].sudo().create({'name': qcontext['student_name'], 'grade': qcontext['grade'],
            'school': school.id, 'parent_id': school.partner_id.id, 'lang': values['lang'],
                    'company_type': 'student'})
i am getting and integrity error when i run this command.I know that there is signup function for res_users
is there a similar function for the res_partner?
Error also contain bad query but the query created using the pdb is given below
INSERT INTO "res_partner" ("id", "notify_email", "color", "company_type", "use_parent_address", "active", "supplier", "tz", "opt_out", "parent_id", "company_id", "grade", "type", "is_company", "lang", "employee", "uniqueid", "customer", "school", "name", "create_uid", "write_uid", "create_date", "write_date") VALUES(nextval('res_partner_id_seq'), 'always', 0, 'student', false, true, false, NULL, false, 46, 1, '9', 'contact', false, 'en_US', false, '/', true, 4, 'Sam', 1, 1, (now() at time zone 'UTC'), (now() at time zone 'UTC')) RETURNING id

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

2 follower(s)


Asked: 8/20/16, 12:28 AM
Seen: 1179 times
Last updated: 3/3/17, 10:52 PM