跳至内容
菜单
此问题已终结
1 回复
5276 查看

Hello, I would like to create a user with the email address in the res.partner object. But it gives me an error of the AccessError type: ('AccessError', u'Sorry, you are not allowed to create this kind of document.) Only users with the following access !!

i need your help



@http.route('/login/signup', type='http', auth="public")
def web_signup(self, **post):
obj_partner = http.request.env['res.partner']
email = 'toto@gmail.com'
# create partner
partner_id = obj_partner.create({
'name': ' ',
'email': email,
}

形象
丢弃
最佳答案

Try:

@http.route('/provencio/signup', type='http', auth="public")
def web_signup(self, **post):
obj_partner = http.request.env['res.partner']
email = 'estelle@gmail.com'
# create partner
partner_id = obj_partner.sudo().create({
'name': ' ',
'email': email,
}



形象
丢弃
相关帖文 回复 查看 活动
0
4月 24
2061
0
12月 19
4763
5
12月 19
3829
0
8月 19
4
5
8月 19
2891