mirror of
https://github.com/OCA/server-backend.git
synced 2025-02-18 09:52:42 +02:00
[FIX] base_user_role: renamed submit form button and redirect to record
This commit is contained in:
@@ -18,9 +18,20 @@ class GroupGroupsIntoRole(models.TransientModel):
|
||||
)
|
||||
|
||||
def create_role(self):
|
||||
selected_group_ids = self._context.get("active_ids", [])
|
||||
selected_group_ids = self.env.context.get("active_ids", [])
|
||||
vals = {
|
||||
"name": self.name,
|
||||
"implied_ids": selected_group_ids,
|
||||
}
|
||||
self.env["res.users.role"].create(vals)
|
||||
role = self.env["res.users.role"].create(vals)
|
||||
|
||||
return {
|
||||
"type": "ir.actions.act_window",
|
||||
"res_model": "res.users.role",
|
||||
"view_mode": "form",
|
||||
"res_id": role.id,
|
||||
"target": "current",
|
||||
"context": {
|
||||
"form_view_ref": "base_user_role.view_res_users_role_form",
|
||||
},
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
</group>
|
||||
<footer>
|
||||
<button
|
||||
string="Group"
|
||||
string="Create"
|
||||
type="object"
|
||||
class="oe_highlight"
|
||||
name="create_role"
|
||||
|
||||
Reference in New Issue
Block a user