[FIX] calendar: allow disabling bus notification in views

Before this commit, when the user group calendar.event by private fields,
a bus notification is sent to exlain that private fields can't be displayed
and the private events are hidden from the result.

It was an issue in some views where group by private fields was used
by default and multiple notifications were displayed.

closes odoo/odoo#131970

Taskid: 3328718
X-original-commit: e3df5d96fc9ca6d7f400c2e0167ef53ebf7c524a
Signed-off-by: Arnaud Joset (arj) <arj@odoo.com>
This commit is contained in:
Arnaud Joset
2023-08-16 09:11:26 +02:00
parent 4daaeca640
commit 2838425742
-5
View File
@@ -679,11 +679,6 @@ class Meeting(models.Model):
if not self.env.su and private_fields:
# display public and confidential events
domain = AND([domain, ['|', ('privacy', '!=', 'private'), ('user_id', '=', self.env.user.id)]])
self.env['bus.bus']._sendone(self.env.user.partner_id, 'simple_notification', {
'type': 'danger',
'title': _('Private Event Excluded'),
'message': _('Grouping by %s is not allowed on private events.', ', '.join([self._fields[field_name].string for field_name in private_fields]))
})
return super(Meeting, self).read_group(domain, fields, groupby, offset=offset, limit=limit, orderby=orderby, lazy=lazy)
return super(Meeting, self).read_group(domain, fields, groupby, offset=offset, limit=limit, orderby=orderby, lazy=lazy)