From 480dfc1538899cfc0528bf39039d649fcfdc2005 Mon Sep 17 00:00:00 2001 From: "Gauthier Wala (gawa)" Date: Fri, 8 Dec 2023 09:51:41 +0100 Subject: [PATCH] [FIX] base_import_module: fix test sql import MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The test tries to import data from an sql file. The problem is that it is trying to import partners, but when the test is ran with the l10n_co localization, one of the required field is not filled. We just change the model to import to avoid the issue with the missing required field. Linked to runbot error 32740, 32742, 32745, 32738 closes odoo/odoo#145708 Signed-off-by: Rémy Voet (ryv) --- addons/base_import_module/tests/test_import_module.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/base_import_module/tests/test_import_module.py b/addons/base_import_module/tests/test_import_module.py index a84a59369e5..767050ae469 100644 --- a/addons/base_import_module/tests/test_import_module.py +++ b/addons/base_import_module/tests/test_import_module.py @@ -42,7 +42,7 @@ class TestImportModule(odoo.tests.TransactionCase): b'"id","name"\n' \ b'bar,bar' ), - ('foo/data.sql', b"INSERT INTO res_partner (active, name) VALUES (true, 'baz');"), + ('foo/data.sql', b"INSERT INTO res_currency (name, symbol, active) VALUES ('New Currency', 'NCU', TRUE);"), ('foo/static/css/style.css', b".foo{color: black;}"), ('foo/static/js/foo.js', b"console.log('foo')"), ('bar/__manifest__.py', b"{'data': ['data.xml']}"), @@ -60,7 +60,7 @@ class TestImportModule(odoo.tests.TransactionCase): self.assertEqual(self.env.ref('foo.foo').name, 'foo') self.assertEqual(self.env.ref('foo.bar')._name, 'res.partner') self.assertEqual(self.env.ref('foo.bar').name, 'bar') - self.assertEqual(self.env['res.partner'].search_count([('name', '=', 'baz')]), 1) + self.assertEqual(self.env['res.currency'].search_count([('symbol', '=', 'NCU')]), 1) self.assertEqual(self.env.ref('bar.foo')._name, 'res.country') self.assertEqual(self.env.ref('bar.foo').name, 'foo')