From e427fbb4cbdf47f3bfbc40af510c797b7f46c165 Mon Sep 17 00:00:00 2001 From: MuK IT GmbH Date: Fri, 12 Oct 2018 22:17:25 +0000 Subject: [PATCH] publish muk_autovacuum - 12.0 --- muk_autovacuum/__manifest__.py | 2 +- muk_autovacuum/models/ir_autovacuum.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/muk_autovacuum/__manifest__.py b/muk_autovacuum/__manifest__.py index 6ef26c2..28d9355 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.8', + 'version': '12.0.2.1.9', '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 2daa5a3..b65d045 100644 --- a/muk_autovacuum/models/ir_autovacuum.py +++ b/muk_autovacuum/models/ir_autovacuum.py @@ -63,7 +63,7 @@ class AutoVacuum(models.AbstractModel): 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) - if count > size: + 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)