diff --git a/addons/google_calendar/models/calendar.py b/addons/google_calendar/models/calendar.py index a835aa06ca2..c9dbb214a39 100644 --- a/addons/google_calendar/models/calendar.py +++ b/addons/google_calendar/models/calendar.py @@ -313,7 +313,7 @@ class Meeting(models.Model): 'useDefault': False, } } - if not self.google_id and not self.videocall_location: + if not self.google_id and not self.videocall_location and not self.location: values['conferenceData'] = {'createRequest': {'requestId': uuid4().hex}} if self.privacy: values['visibility'] = self.privacy diff --git a/addons/google_calendar/tests/test_sync_common.py b/addons/google_calendar/tests/test_sync_common.py index b5fd0354a40..8ebf95309a9 100644 --- a/addons/google_calendar/tests/test_sync_common.py +++ b/addons/google_calendar/tests/test_sync_common.py @@ -76,3 +76,8 @@ class TestSyncGoogle(HttpCase): while funcs: func = funcs.popleft() func() + + def assertGoogleEventHasNoConferenceData(self): + GoogleSync._google_insert.assert_called_once() + args, _ = GoogleSync._google_insert.call_args + self.assertFalse(args[1].get('conferenceData', False)) diff --git a/addons/google_calendar/tests/test_sync_odoo2google.py b/addons/google_calendar/tests/test_sync_odoo2google.py index 6dcefb737d6..9b4e21cc52e 100644 --- a/addons/google_calendar/tests/test_sync_odoo2google.py +++ b/addons/google_calendar/tests/test_sync_odoo2google.py @@ -764,3 +764,17 @@ class TestSyncOdoo2Google(TestSyncGoogle): self.assertFalse(record.active, "Event must be archived in Odoo after unlinking it") self.assertTrue(record.need_sync, "Sync variable must be true for updating event in Google when sync re-activates") self.assertGoogleEventNotDeleted() + + @patch_api + def test_videocall_location_on_location_set(self): + partner = self.env['res.partner'].create({'name': 'Jean-Luc', 'email': 'jean-luc@opoo.com'}) + event = self.env['calendar.event'].create({ + 'name': "Event", + 'start': datetime(2020, 1, 15, 8, 0), + 'stop': datetime(2020, 1, 15, 18, 0), + 'partner_ids': [(4, partner.id)], + 'need_sync': False, + 'location' : 'Event Location' + }) + event._sync_odoo2google(self.google_service) + self.assertGoogleEventHasNoConferenceData()