Odoo Help


This community 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.


Creating A User in res_partner with python controller in website signup

on 8/20/16, 12:28 AM 192 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

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

2 follower(s)


Asked: 8/20/16, 12:28 AM
Seen: 192 times
Last updated: 8/22/16, 11:50 AM