Se rendre au contenu
Menu
Cette question a été signalée
1 Répondre
5520 Vues

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
Ignorer
Meilleure réponse

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
Ignorer
Auteur

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

Publications associées Réponses Vues Activité
0
janv. 16
4682
3
janv. 16
7055
0
juil. 16
3754
3
déc. 19
8111
2
avr. 19
6410