Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odgovori
3441 Prikazi

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
Opusti
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
Opusti
Avtor

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
Opusti
Related Posts Odgovori Prikazi Aktivnost
1
feb. 22
5595
1
jun. 25
1872
3
jul. 25
3481
1
maj 25
1605
1
maj 25
1850