diff --git a/__init__.py b/__init__.py index f804a80c38..752dca49bf 100644 --- a/__init__.py +++ b/__init__.py @@ -3,6 +3,7 @@ from trytond.pool import Pool from . import res +from . import ir __all__ = ['register'] @@ -13,6 +14,7 @@ def register(): res.RoleGroup, res.User, res.UserRole, + ir.Cron, module='user_role', type_='model') Pool.register( module='user_role', type_='wizard') diff --git a/ir.py b/ir.py new file mode 100644 index 0000000000..e9897f816a --- /dev/null +++ b/ir.py @@ -0,0 +1,13 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. +from trytond.pool import PoolMeta + + +class Cron(metaclass=PoolMeta): + __name__ = 'ir.cron' + + @classmethod + def __setup__(cls): + super().__setup__() + cls.method.selection.append( + ('res.user|sync_roles', "Synchronize Users Roles")) diff --git a/res.xml b/res.xml index 479fee25b9..7406ad3035 100644 --- a/res.xml +++ b/res.xml @@ -85,26 +85,10 @@ this repository contains the full copyright notices and license terms. --> - - user_cron_role - Cron Role - - - - - - - - Synchronize Users Roles - - - + res.user|sync_roles - - - res.user - sync_roles + days