From 4e3b1c88f3e66014856472faa2a30f041928ecc1 Mon Sep 17 00:00:00 2001 From: MuK IT GmbH Date: Fri, 4 Jan 2019 16:42:04 +0000 Subject: [PATCH] publish muk_autovacuum - 12.0 --- muk_autovacuum/__manifest__.py | 2 +- muk_autovacuum/models/ir_autovacuum.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/muk_autovacuum/__manifest__.py b/muk_autovacuum/__manifest__.py index a9ec371..4ba7655 100644 --- a/muk_autovacuum/__manifest__.py +++ b/muk_autovacuum/__manifest__.py @@ -20,7 +20,7 @@ { 'name': 'MuK Autovacuum', 'summary': 'Configure automatic garbage collection', - 'version': '12.0.2.1.9', + 'version': '12.0.2.1.10', 'category': 'Extra Tools', 'license': 'AGPL-3', 'author': 'MuK IT', diff --git a/muk_autovacuum/models/ir_autovacuum.py b/muk_autovacuum/models/ir_autovacuum.py index b65d045..86177c5 100644 --- a/muk_autovacuum/models/ir_autovacuum.py +++ b/muk_autovacuum/models/ir_autovacuum.py @@ -59,18 +59,18 @@ class AutoVacuum(models.AbstractModel): if rule.only_inactive and "active" in rule.model.field_id.mapped("name"): domain.append(('active', '=', False)) _logger.info(_("GC domain: %s"), domain) - records = model.with_context({'active_test': False}).search(domain) + records = model.with_context(active_test=False).search(domain) elif rule.state == 'size': size = rule.size if rule.size_type == 'fixed' else rule.size_parameter_value - count = model.with_context({'active_test': False}).search([], count=True) + count = model.with_context(active_test=False).search([], count=True) if size and size > 0 and count > size: limit = count - size _logger.info(_("GC domain: [] order: %s limit: %s"), rule.size_order, limit) - records = model.with_context({'active_test': False}).search([], order=rule.size_order, limit=limit) + records = model.with_context(active_test=False).search([], order=rule.size_order, limit=limit) elif rule.state == 'domain': _logger.info(_("GC domain: %s"), rule.domain) domain = safe_eval(rule.domain or "[]", rules._get_eval_domain_context()) - records = model.with_context({'active_test': False}).search(domain) + records = model.with_context(active_test=False).search(domain) if rule.only_attachments: attachments = self.env['ir.attachment'].sudo().search([ ('res_model', '=', rule.model.model),