Skip to Content
Menu
This question has been flagged
1 Reply
4746 Views

hi,

i created one custom module in odoo v9

in controller i am not pass any "auth" parameter

after login administrator in odoo it submit form and work perfectly

but when i create another user in odoo from signup form and try to submit form so it return 403:forbidden errore

in log file it look like

"

AccessError: (u'Sorry, you are not allowed to create this kind of document. Please contact your system administrator if you think this is an error.\n\n(Document model: consulate.afidavit)', None)

"
so how can i solve this error

Avatar
Discard
Best Answer

Hi,


When you create you new object you should use:

request.env['..'].sudo().create('..');

In the old API you should use:

from openerp import SUPERUSER_ID

request.registry['...'].create(cr, SUPERUSER_ID, place.id, ..., context)

Then you are in the super user right.

Best Regards

Avatar
Discard
Author

hi,Thanks for your reply but in my controller i am not create any user,only get login user detail from "cust = http.request.env.user" and save in res.partner(onetomany) fields like "'partner_id': cust.id," it works in only when admin is logged in otherwise it return 403:forbidden error,so how we remove this error

Related Posts Replies Views Activity
0
Jan 16
3829
3
Jan 16
6104
0
Jul 16
2824
3
Dec 19
6996
2
Apr 19
6410