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

How can I automatic unlink (uncheck) groups when create a new user?

base code:

<record id="default_user" model="res.users">
<field name="groups_id" eval="[Command.link(ref('base.group_partner_manager')), Command.link(ref('base.group_allow_export'))]"/>
record>

I tried (but not work):

<recordid="base.default_user"model="res.users"><fieldname="groups_id"eval="[(3,ref('base.group_partner_manager')), (3,ref('base.group_allow_export'))]"/>record>

形象
丢弃
最佳答案

Hi Nedera,

Try with Command.unlink.

≤record id="base.default_user" model="res.users" >
≤field name="groups_id" eval="[Command.unlink(ref('base.group_partner_manager')), Command.unlink(ref('base.group_allow_export'))]"/ >
≤/record >

It will works on a new database or when you install your custom module with this code.

Please vote the answer if it works.

形象
丢弃
编写者

yes, this code only work when reinstall module. (3,('base.group_partner_manager')) is still ok

Hope it will help you.
Please vote the answer.

can you please explain "Command.link" ?

最佳答案

Hi Nedera,

Under Settings --> General Settings --> Permissions --> Default Access RIghts (mark is checked).

You will see Default Access Rights under the check box. Click on it will take you to "Default User Template". Configure the groups if required or remove all the groups. This might fulfill your requirement.


形象
丢弃
相关帖文 回复 查看 活动
1
2月 22
5618
1
6月 25
1879
3
7月 25
3485
1
5月 25
1613
1
5月 25
1855