Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
5588 มุมมอง

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

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

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

อวตาร
ละทิ้ง
ผู้เขียน

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 ตอบกลับ มุมมอง กิจกรรม
0
ม.ค. 16
4779
3
ม.ค. 16
7106
0
ก.ค. 16
3849
3
ธ.ค. 19
8187
2
เม.ย. 19
6410