Merge pull request #157 from acsone/8.0-fix-active-test-propagation
[FIX][cron_run_manually] active_test cannot be propagated to the method to executepull/165/head
commit
6de7fba468
|
@ -60,8 +60,13 @@ class Cron(models.Model):
|
||||||
|
|
||||||
_logger.info('Job `%s` triggered from form', self.name)
|
_logger.info('Job `%s` triggered from form', self.name)
|
||||||
|
|
||||||
|
# Do not propagate active_test to the method to execute
|
||||||
|
ctx = dict(self.env.context)
|
||||||
|
ctx.pop('active_test', None)
|
||||||
|
|
||||||
# Execute the cron job
|
# Execute the cron job
|
||||||
method = getattr(self.sudo(self.user_id).env[self.model],
|
method = getattr(
|
||||||
|
self.with_context(ctx).sudo(self.user_id).env[self.model],
|
||||||
self.function)
|
self.function)
|
||||||
args = safe_eval('tuple(%s)' % (self.args or ''))
|
args = safe_eval('tuple(%s)' % (self.args or ''))
|
||||||
return method(*args)
|
return method(*args)
|
||||||
|
|
Loading…
Reference in New Issue