Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
3 ตอบกลับ
7730 มุมมอง

Hi there, i want to set default group when create a new user. do u have any idea or do you know where should i put this code?




อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hello Dear,

You can go to Settings >> Settings & Companies >> Users  menu & Then Filter Archived Users, In that you will get "Default User Template" User in list.

By default any new user gets Groups same as that user. Based on need you can update groups on that user and it will do the job.

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hello Edward Nguyen,

Please try below code it will help you

Put this code in your security -> security.xml file. By this whenever you will create new user by default group will assign to that user.










Thanks & Regards,
Email: odoo@aktivsoftware.com
Skype: kalpeshmaheshwari 

อวตาร
ละทิ้ง

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="1">
<record id="base.default_user" model="res.users">
<field name="groups_id" eval="[(4, ref('module_name.custom_group_name'))]"/>
</record>
</data>
</odoo>

ผู้เขียน คำตอบที่ดีที่สุด

Thanks about your answer. I just wanna ask about how to code it ^.^!

อวตาร
ละทิ้ง