From 541411ea042f8b94682695cdb66f769ab5a62491 Mon Sep 17 00:00:00 2001 From: nobuQuartile Date: Thu, 19 Dec 2024 08:45:03 +0000 Subject: [PATCH] [IMP] auditlog The test code for OCB has been updated, causing errors in the module, so I will update the module to the latest version. --- auditlog/tests/test_multi_company.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/auditlog/tests/test_multi_company.py b/auditlog/tests/test_multi_company.py index 404f395d..18902595 100644 --- a/auditlog/tests/test_multi_company.py +++ b/auditlog/tests/test_multi_company.py @@ -1,10 +1,9 @@ from unittest.mock import patch from odoo.fields import Command +from odoo.models import BaseModel from odoo.tests.common import TransactionCase -from odoo.addons.base.models.res_users import Groups - class TestMultiCompany(TransactionCase): @classmethod @@ -78,10 +77,12 @@ def write(self, vals): present in the cache at this point, leading to the deletion of the value from the company that is inaccessible to the current user. """ - return super(Groups, self).write(vals) + return BaseModel.write(self, vals) # Do the write. - with patch.object(Groups, "write", side_effect=write, autospec=True): + with patch.object( + self.env["res.groups"].__class__, "write", side_effect=write, autospec=True + ): group_with_user.write({"users": [Command.set(self.user2.ids)]}) self.assertEqual(group_with_user.users, self.user2) # Ensure that the users of the other companies are still there.