Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
2 Risposte
3445 Visualizzazioni

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
Abbandona
Risposta migliore

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
Abbandona
Autore

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

Risposta migliore

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
Abbandona
Post correlati Risposte Visualizzazioni Attività
1
feb 22
5595
1
giu 25
1874
3
lug 25
3481
1
mag 25
1605
1
mag 25
1850