Skip to Content
Menu
This question has been flagged
2 Replies
2261 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
4292
2
Dec 24
3122
1
Dec 24
350
4
Nov 24
1364
1
Sep 24
1134