From cc23a80c19e2761f0e20ad6c49a4b774fddbdce2 Mon Sep 17 00:00:00 2001 From: Fabien BOURGEOIS Date: Sun, 13 May 2018 09:11:37 +0200 Subject: [PATCH] [FIX]Radicale Odoo Storage : event should take care of context (virtual_id problem) --- radicale_odoo_storage/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/radicale_odoo_storage/__init__.py b/radicale_odoo_storage/__init__.py index dfa2f84..ec302d9 100644 --- a/radicale_odoo_storage/__init__.py +++ b/radicale_odoo_storage/__init__.py @@ -176,8 +176,10 @@ class Collection(BaseCollection): domain = [('partner_ids', '=', pid)] else: domain = [] - events = cls.odoo.execute_kw('calendar.event', 'search_read', - [domain], {'fields': fields}) + # Needed to ensure context + event_ids = cls.odoo.env['calendar.event'].search(domain) + events = cls.odoo.execute_kw('calendar.event', 'read', + [event_ids], {'fields': fields}) cls.events = {e['id']: e for e in events} # WARNING: Odoo does not remove from database deleted recurrent events... # Should be fixed on Odoo side and will be fixed via 2way here too