Skip to Content
Menu
This question has been flagged
2 Replies
3463 Views

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>

Avatar
Discard
Best Answer

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.

Avatar
Discard
Author

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" ?

Best Answer

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.


Avatar
Discard
Related Posts Replies Views Activity
1
Feb 22
5605
1
Jun 25
1877
3
Jul 25
3483
1
May 25
1610
1
May 25
1855