Skip to content

Commit 7009d31

Browse files
committed
[REF] util/orm: rename group subscription field for clarity
The community counterpart of this commit renames the 'group_ids' field to 'auto_subscribe_group_ids'. This commit updates the related logic to maintain consistency.
1 parent 0e5bd20 commit 7009d31

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

src/util/orm.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,13 @@ def get_admin_channel(cr):
104104
search_rules = [
105105
("channel_type", "=", "channel"),
106106
("group_public_id", "=", admin_group.id),
107-
("group_ids", "in", admin_group.id),
108107
]
109108
if "public" in e[channel_model_name]._fields:
110109
search_rules.append(("public", "=", "groups"))
110+
if "group_ids" in e[channel_model_name]._fields:
111+
search_rules.append(("group_ids", "in", admin_group.id))
112+
if "auto_subscribe_group_ids" in e[channel_model_name]._fields:
113+
search_rules.append(("auto_subscribe_group_ids", "in", admin_group.id))
111114
admin_channel = next(
112115
iter(e[channel_model_name].search(search_rules).sorted(lambda c: "admin" not in c.name.lower()) or []),
113116
None,
@@ -117,10 +120,13 @@ def get_admin_channel(cr):
117120
"name": "Administrators",
118121
"channel_type": "channel",
119122
"group_public_id": admin_group.id,
120-
"group_ids": [(6, 0, [admin_group.id])],
121123
}
122124
if "public" in e[channel_model_name]._fields:
123125
channel_values["public"] = "groups"
126+
if "group_ids" in e[channel_model_name]._fields:
127+
channel_values["group_ids"] = [(6, 0, [admin_group.id])]
128+
if "auto_subscribe_group_ids" in e[channel_model_name]._fields:
129+
channel_values["auto_subscribe_group_ids"] = [(6, 0, [admin_group.id])]
124130
admin_channel = e[channel_model_name].create(channel_values)
125131

126132
e["ir.model.data"].create(

0 commit comments

Comments
 (0)