I have already set the permissions of my module,There are 3 kinds of permissions as"User","Leader","Manager":
<?xml version="1.0" ?>
<odoo>
<record id="module_firmware_category" model="ir.module.category">
<field name="name">firmware_module</field>
</record>
<record id="firmware_group_user" model="res.groups">
<field name="name">User</field>
<field name="category_id" ref="module_firmware_category" />
<field name="implied_ids" eval="[(4, ref('base.group_user'))]" />
</record>
<record id="firmware_group_leader" model="res.groups">
<field name="name">Leader</field>
<field name="category_id" ref="module_firmware_category" />
<field name="implied_ids" eval="[(4, ref('firmware_group_user'))]" />
</record>
<record id="firmware_group_manager" model="res.groups">
<field name="name">Manager</field>
<field name="category_id" ref="module_firmware_category" />
<field name="implied_ids" eval="[(4, ref('firmware_group_leader'))]" />
<field name="users" eval="[
(4, ref('base.user_root')),
(4, ref('base.user_admin'))
]" />
</record>
</odoo>
Then in my python code I want to add a field connected with the permissions:
user_type = fields.Selection([('Tiger_1', 'I'),('Tiger_2','II'),('Tiger_3','III')])
I want to set user_type with 'I' when permissions is 'User',and 'II' when permissions is 'Leader',and'III' when permissions is 'Manager',I want to this field be set automatically to avoid mistakes ,how should I add my codes?
Thanks.