mirror of
https://github.com/OCA/server-backend.git
synced 2025-02-18 09:52:42 +02:00
[FIX] base_user_role: renamed wizard name and use active_ids
This commit is contained in:
@@ -10,7 +10,7 @@ class GroupGroupsIntoRole(models.TransientModel):
|
||||
This wizard is used to group different groups into a role.
|
||||
"""
|
||||
|
||||
_name = "group.groups.into.role"
|
||||
_name = "wizard.groups.into.role"
|
||||
_description = "Group groups into a role"
|
||||
name = fields.Char(
|
||||
required=True,
|
||||
@@ -18,7 +18,7 @@ class GroupGroupsIntoRole(models.TransientModel):
|
||||
)
|
||||
|
||||
def create_role(self):
|
||||
selected_group_ids = self.env.context.get("selected_group_ids", [])
|
||||
selected_group_ids = self._context.get("active_ids", [])
|
||||
vals = {
|
||||
"name": self.name,
|
||||
"implied_ids": selected_group_ids,
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<odoo>
|
||||
<record id="group_groups_into_role_wiz_view" model="ir.ui.view">
|
||||
<field name="name">group.groups.into.role.wiz.view</field>
|
||||
<field name="model">group.groups.into.role</field>
|
||||
<field name="name">wizard.groups.into.role.wiz.view</field>
|
||||
<field name="model">wizard.groups.into.role</field>
|
||||
<field name="arch" type="xml">
|
||||
<form>
|
||||
<group>
|
||||
@@ -29,10 +29,10 @@
|
||||
action = {
|
||||
'name': 'Specify a name for your new role',
|
||||
'type': 'ir.actions.act_window',
|
||||
'res_model': 'group.groups.into.role',
|
||||
'res_model': 'wizard.groups.into.role',
|
||||
'target': 'new',
|
||||
'views':[(env.ref('base_user_role.group_groups_into_role_wiz_view').id, 'form')],
|
||||
'context': {'selected_group_ids': [group.id for group in records]},
|
||||
'context': env.context
|
||||
}
|
||||
</field>
|
||||
</record>
|
||||
|
||||
Reference in New Issue
Block a user