From f8b6d2f17d701b0f39e384330808e470fa4a5655 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Hennecart?= Date: Wed, 12 Aug 2020 07:01:16 +0000 Subject: [PATCH] [IMP] calendar: save filters of the calendar view for the user - We now save the status of each filters to avoid the user to do the same operations, if he go elsewhere in the meantime. Task ID 2196775 COM PR: odoo/odoo#55190 ENT PR: odoo/enterprise#12196 UPG PR: odoo/upgrade#1532 Co-authored-by: Simon Genin (ges) Co-authored-by: jeh-odoo --- addons/calendar/models/calendar_contact.py | 2 ++ addons/calendar/views/calendar_views.xml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/calendar/models/calendar_contact.py b/addons/calendar/models/calendar_contact.py index 6885450fa27..9a8a002872a 100644 --- a/addons/calendar/models/calendar_contact.py +++ b/addons/calendar/models/calendar_contact.py @@ -11,6 +11,8 @@ class Contacts(models.Model): user_id = fields.Many2one('res.users', 'Me', required=True, default=lambda self: self.env.user) partner_id = fields.Many2one('res.partner', 'Employee', required=True) active = fields.Boolean('Active', default=True) + partner_checked = fields.Boolean('Checked', default=True, + help="This field is used to know if the partner is checked in the filter of the calendar view for the user_id.") _sql_constraints = [ ('user_id_partner_id_unique', 'UNIQUE(user_id, partner_id)', 'A user cannot have the same contact twice.') diff --git a/addons/calendar/views/calendar_views.xml b/addons/calendar/views/calendar_views.xml index b539e1a021a..3e6fba1eb69 100644 --- a/addons/calendar/views/calendar_views.xml +++ b/addons/calendar/views/calendar_views.xml @@ -277,7 +277,7 @@ - +