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

in my module I call compose message wizard like this:

...
return {
'type': 'ir.actions.act_window',
'view_type': 'form',
'view_mode': 'form',
'res_model': 'mail.compose.message',
'views': [(compose_form_id, 'form')],
'view_id': compose_form_id,
'target': 'new',
'context': ctx,
}
the wizard shows but the send mail fails with access denied error because the user has no writing rights to the model . So I want to call the wizard with root privileges?
I know about sudo() but in this case I cannot use it. Is there a way to pass uid as a context to the action?
形象
丢弃
最佳答案

Hi,

You can change self to self.sudo() within method where you've added this wizard.

Thanks!

形象
丢弃
编写者

it's called from a button:

<button name="action_send_mail" string="Send by Mail" type="object"/>

I cannot use sudo() there

相关帖文 回复 查看 活动
0
8月 23
8
2
11月 22
3370
1
10月 20
7166
2
3月 15
4579
0
12月 22
2363