Skip to content

Commit 9de4448

Browse files
committed
[MIG] base_group_backend: Migration to 18.0
1 parent a131cc3 commit 9de4448

File tree

5 files changed

+16
-13
lines changed

5 files changed

+16
-13
lines changed

base_group_backend/__manifest__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
33
{
44
"name": "Group backend",
5-
"version": "16.0.1.1.0",
5+
"version": "18.0.1.0.0",
66
"development_status": "Alpha",
77
"category": "Tools",
88
"author": "Pierre Verkest, Odoo Community Association (OCA)",

base_group_backend/data/res_groups.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,10 @@
3131
ref('base.ir_filters_employee_rule'),
3232
ref('base.res_company_rule_employee'),
3333
ref('mail.ir_rule_mail_notifications_group_user'),
34-
ref('mail.ir_rule_mail_channel_member_group_user'),
34+
ref('mail.ir_rule_discuss_channel_all'),
35+
ref('mail.ir_rule_discuss_channel_member_is_self_all'),
36+
ref('mail.ir_rule_discuss_channel_member_read_all'),
3537
ref('mail.mail_activity_rule_user'),
36-
ref('mail.mail_channel_rule'),
3738
]),
3839
]"
3940
/>

base_group_backend/demo/backend_dummy_model.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
<?xml version="1.0" encoding="utf-8" ?>
22
<odoo noupdate="1">
33
<record id="backend_dummy_model_tree_view" model="ir.ui.view">
4-
<field name="name">Backend dummy tree view</field>
4+
<field name="name">Backend dummy list view</field>
55
<field name="model">backend.dummy.model</field>
66
<field name="arch" type="xml">
7-
<tree create="false" delete="false">
7+
<list create="false" delete="false">
88
<field name="my_value" />
99
<field name="my_other_value" groups="base.group_user" />
10-
</tree>
10+
</list>
1111
</field>
1212
</record>
1313

1414
<record id="action_dummy_list" model="ir.actions.act_window">
1515
<field name="name">Dummies</field>
1616
<field name="type">ir.actions.act_window</field>
1717
<field name="res_model">backend.dummy.model</field>
18-
<field name="view_mode">tree,form,kanban,calendar,pivot,graph,activity</field>
18+
<field name="view_mode">list,form,kanban,calendar,pivot,graph,activity</field>
1919
<field name="view_id" ref="backend_dummy_model_tree_view" />
2020
</record>
2121

base_group_backend/models/res_users.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class Users(models.Model):
99
_inherit = "res.users"
1010

1111
@api.model
12-
def has_group(self, group_ext_id):
12+
def _has_group(self, group_ext_id):
1313
"""While ensuring a user is part of `base.group_user` this code will
1414
try if user is in the `base_group_backend.group_backend` group to let access
1515
to the odoo backend.
@@ -21,11 +21,11 @@ def has_group(self, group_ext_id):
2121
As far `base.group_user` have a lot of default permission this
2222
makes hard to maintain proper access right according your business.
2323
"""
24-
res = super().has_group(group_ext_id)
24+
res = super()._has_group(group_ext_id)
2525
if not res and (group_ext_id == "base.group_user"):
26-
has_base_group_backend = super().has_group(
26+
has_base_group_backend = super()._has_group(
2727
"base_group_backend.base_group_backend"
28-
) or super().has_group("base_group_backend.group_backend_ui_users")
28+
) or super()._has_group("base_group_backend.group_backend_ui_users")
2929
if has_base_group_backend:
3030
_logger.debug(
3131
"Forcing has_group to return True"

base_group_backend/security/ir.model.access.csv

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ backend_ui_users_ir_ui_menu,backend_ui_users_ir_ui_menu,base.model_ir_ui_menu,gr
1111
backend_ui_users_ir_attachment,backend_ui_users_ir_attachment,base.model_ir_attachment,group_backend_ui_users,1,0,1,0
1212
backend_ui_users_res_partner,backend_ui_users_res_partner,base.model_res_partner,group_backend_ui_users,1,0,0,0
1313
backend_ui_users_bus_presence,backend_ui_users_bus_presence,bus.model_bus_presence,group_backend_ui_users,1,1,1,1
14-
backend_ui_users_mail_channel_member_public,backend_ui_users_mail_channel_member,mail.model_mail_channel_member,group_backend_ui_users,1,1,1,0
15-
backend_ui_users_mail_channel_public,backend_ui_users_mail_channel_member,mail.model_mail_channel,group_backend_ui_users,1,1,1,0
14+
backend_ui_users_discuss_channel_member_public,backend_ui_users_discuss_channel_member,mail.model_discuss_channel_member,group_backend_ui_users,1,1,1,0
15+
backend_ui_users_discuss_channel_public,backend_ui_users_discuss_channel_member,mail.model_discuss_channel,group_backend_ui_users,1,1,1,0
1616
backend_ui_users_mail_activity,backend_ui_users_mail_activity,mail.model_mail_activity,group_backend_ui_users,1,1,1,1
1717
backend_ui_users_mail_activity_type,backend_ui_users_mail_activity_type,mail.model_mail_activity_type,group_backend_ui_users,1,0,0,0
1818
backend_ui_users_mail_followers,backend_ui_users_mail_followers,mail.model_mail_followers,group_backend_ui_users,1,0,0,0
@@ -25,10 +25,12 @@ backend_ui_users_mail_message,backend_ui_users_mail_message,mail.model_mail_mess
2525
backend_ui_users_mail_resend_message,backend_ui_users_mail_resend_message,mail.model_mail_resend_message,group_backend_ui_users,1,1,1,0
2626
backend_ui_users_mail_notification,backend_ui_users_mail_notification,mail.model_mail_notification,group_backend_ui_users,1,1,1,1
2727
backend_ui_users_mail_alias,backend_ui_users_mail_alias,mail.model_mail_alias,group_backend_ui_users,1,0,0,0
28+
backend_ui_users_mail_guest,backend_ui_users_mail_guest,mail.model_mail_guest,group_backend_ui_users,1,0,0,0
2829
backend_ui_users_res_groups,backend_ui_users_res_groups,base.model_res_groups,group_backend_ui_users,1,0,0,0
2930
backend_ui_users_res_partner_category,backend_ui_users_res_partner_category,base.model_res_partner_category,group_backend_ui_users,1,0,0,0
3031
backend_ui_users_res_partner_industry,backend_ui_users_res_partner_industry,base.model_res_partner_industry,group_backend_ui_users,1,0,0,0
3132
backend_ui_users_res_users_identitycheck,backend_ui_users_res_users_identitycheck,base.model_res_users_identitycheck,group_backend_ui_users,1,1,1,0
33+
backend_ui_users_res_public,res_users all,model_res_users,group_backend_ui_users,1,0,0,0
3234
backend_ui_users_res_bank,backend_ui_users_res_bank,base.model_res_bank,group_backend_ui_users,1,0,0,0
3335
backend_ui_users_res_partner_bank,backend_ui_users_res_partner_bank,base.model_res_partner_bank,group_backend_ui_users,1,0,0,0
3436
backend_ui_users_res_calendar_event,backend_ui_users_res_calendar_event,calendar.model_calendar_event,group_backend_ui_users,1,0,0,0

0 commit comments

Comments
 (0)