Browse Source

publish muk_autovacuum - 12.0

pull/9/head
MuK IT GmbH 6 years ago
parent
commit
e427fbb4cb
  1. 2
      muk_autovacuum/__manifest__.py
  2. 2
      muk_autovacuum/models/ir_autovacuum.py

2
muk_autovacuum/__manifest__.py

@ -20,7 +20,7 @@
{ {
'name': 'MuK Autovacuum', 'name': 'MuK Autovacuum',
'summary': 'Configure automatic garbage collection', 'summary': 'Configure automatic garbage collection',
'version': '12.0.2.1.8',
'version': '12.0.2.1.9',
'category': 'Extra Tools', 'category': 'Extra Tools',
'license': 'AGPL-3', 'license': 'AGPL-3',
'author': 'MuK IT', 'author': 'MuK IT',

2
muk_autovacuum/models/ir_autovacuum.py

@ -63,7 +63,7 @@ class AutoVacuum(models.AbstractModel):
elif rule.state == 'size': elif rule.state == 'size':
size = rule.size if rule.size_type == 'fixed' else rule.size_parameter_value 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 count > size:
if size and size > 0 and count > size:
limit = count - size limit = count - size
_logger.info(_("GC domain: [] order: %s limit: %s"), rule.size_order, limit) _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)

Loading…
Cancel
Save