Skip to content

[18.0][FIX] autovacuum_message_attachment: Add missing message_type 'auto_comment' and allow to batch deletion#3665

Open
divad1196 wants to merge 3 commits into
OCA:18.0from
camptocamp:fix_vacuum_rule_message_type
Open

[18.0][FIX] autovacuum_message_attachment: Add missing message_type 'auto_comment' and allow to batch deletion#3665
divad1196 wants to merge 3 commits into
OCA:18.0from
camptocamp:fix_vacuum_rule_message_type

Conversation

@divad1196

@divad1196 divad1196 commented Jul 3, 2026

Copy link
Copy Markdown
  • auto_comment message_type was missing
    => Add the option
  • Deletion could timeout due to the number of records to delete
    => Added batch_size parameter to the rules
  • Optimization:
    • search performed orderby which forces an extra sort on the whole table
      => Use _search instead
    • unlink is batched by Odoo natively, and batch_unlink was also batching with its own value
      => Make them use the same limit and added a batch size parameter to batch_unlink

@OCA-git-bot

Copy link
Copy Markdown
Contributor

Hi @florian-dacosta,
some modules you are maintaining are being modified, check this out!

@OCA-git-bot OCA-git-bot added series:18.0 mod:autovacuum_message_attachment Module autovacuum_message_attachment labels Jul 3, 2026
@divad1196 divad1196 changed the title [FIX] Add missing message_type 'auto_comment' [18.0][FIX] autovacuum_message_attachment: Add missing message_type 'auto_comment' and allow to batch deletion Jul 3, 2026
@divad1196
divad1196 force-pushed the fix_vacuum_rule_message_type branch from 70113ae to e6088fe Compare July 3, 2026 13:54
@divad1196
divad1196 marked this pull request as ready for review July 3, 2026 13:54
@divad1196
divad1196 force-pushed the fix_vacuum_rule_message_type branch from e6088fe to 039f8aa Compare July 10, 2026 11:16
@divad1196
divad1196 force-pushed the fix_vacuum_rule_message_type branch from 039f8aa to 9e35c6f Compare July 10, 2026 11:23
with Registry(self.env.cr.dbname).cursor() as new_cr:
if batch_size == -1:
batch_size = len(self)
if not batch_size or batch_size < 0:

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: use if not batch_size or batch_size < new_cr.IN_MAX: instead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:autovacuum_message_attachment Module autovacuum_message_attachment series:18.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants