From 09d2ddecaf4fc6474c96acf1f4a12de4789caef8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Voet=20=28ryv=29?= Date: Tue, 20 Oct 2020 08:07:40 +0000 Subject: [FIX] base: fix `populate.randint` tool MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The randint generator generated always `None` because the `return` was forget in method of `populate.compute`. - Add a test for the randint tool, and fix the issue. - Change the documentation of `_populate_factories` to be more explicit about the custom generator. closes odoo/odoo#60327 Signed-off-by: Xavier Dollé (xdo) --- odoo/tools/populate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'odoo/tools') diff --git a/odoo/tools/populate.py b/odoo/tools/populate.py index d44092a9378..5a0f3e2027d 100644 --- a/odoo/tools/populate.py +++ b/odoo/tools/populate.py @@ -146,5 +146,5 @@ def randint(a, b, seed=None): :rtype: function (iterator, str, str) -> dict """ def get_rand_int(random=None, **kwargs): - random.randint(a, b) + return random.randint(a, b) return compute(get_rand_int, seed=seed) -- cgit v1.2.3