diff --git a/sync/models/sync_project_demo.py b/sync/models/sync_project_demo.py index 4211e81c..68104c5c 100644 --- a/sync/models/sync_project_demo.py +++ b/sync/models/sync_project_demo.py @@ -60,8 +60,8 @@ def odoo_execute_kw(model, method, *args, **kwargs): params.DB, secrets.USERNAME, secrets.PASSWORD, {} ) models = _client.ServerProxy("{}/xmlrpc/2/object".format(params.URL)) - except OSError: - raise RetryableJobError("Error on connecting to external Odoo") + except OSError as err: + raise RetryableJobError("Error on connecting to external Odoo") from err res = models.execute_kw( params.DB, uid, secrets.PASSWORD, model, method, args, kwargs ) diff --git a/sync/tests/test_links.py b/sync/tests/test_links.py index aa437fda..f11ca733 100644 --- a/sync/tests/test_links.py +++ b/sync/tests/test_links.py @@ -180,10 +180,10 @@ def test_external_link(self): # one2many self.set_link(REL, {"github": 5, "trello": 105}) - with self.assertRaises(Exception): + with self.assertRaises(ValidationError): self.set_link(REL, {"github": 5, "trello": 1005}) self.set_link(REL, {"github": 5, "trello": 1005}, allow_many2many=True) - with self.assertRaises(Exception): + with self.assertRaises(ValidationError): glink = self.get_link(REL, {"github": 5, "trello": None}) glinks = self.search_links(REL, {"github": 5, "trello": None}) self.assertEqual(2, len(glinks))