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)