Skip to content

Conversation

@drkpkg
Copy link

@drkpkg drkpkg commented Nov 7, 2025

  • Add server actions to trigger subscribe/unsubscribe from list view
  • Ensure return type suits server action flow
  • Support bulk handling without interfering with form buttons

- add server actions to trigger subscribe/unsubscribe from list view
- ensure return type suits server action flow
- support bulk handling without interfering with form buttons
- Removed the Odoo Community banner image from README.
- Corrected spelling of "license" to "licence" in badge link.
- Updated HTML title to "Audit Log" for better clarity.
- Changed section headings from <h2> to <h1> for improved structure in HTML documentation.
- Ensured proper formatting and consistency across documentation files.
- Introduced a new test class for bulk subscribe and unsubscribe actions.
- Implemented tests to verify the correct behavior of bulk subscription and unsubscription for audit log rules.
- Ensured that the state of rules is correctly updated after bulk actions.
@drkpkg
Copy link
Author

drkpkg commented Nov 7, 2025

@StefanRijnhart after the rebase from #3432 this feature is the only left.
This bulk feature is useful when you have a large number of rules to subscribe or unsubscribe.

Note: #3437 is discarded after the rebase from #3432.

Copy link
Member

@StefanRijnhart StefanRijnhart left a comment

Choose a reason for hiding this comment

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

Thanks for the rebase!
Points of order:

Code review:

  • Returning another action with soft-reload is not necessary. Odoo will already update the rules statuses without it. That means we can avoid adding the new methods as you can just call the existing subscribe/unsubcribe ones.
  • The original subscribe method is not reentrant. It will happily create duplicate window actions to set as the rule's action_id. Given that the UI now allows to call subscribe on subscribed records, can you fix this?

@StefanRijnhart StefanRijnhart added this to the 18.0 milestone Nov 8, 2025
@drkpkg drkpkg changed the title [FEAT] Add bulk subscribe actions for auditlog rules [IMP] Add bulk subscribe actions for auditlog rules Nov 8, 2025
- Updated the bulk subscribe method to only subscribe rules that are not already subscribed.
- Modified the bulk unsubscribe method to only unsubscribe rules that are currently subscribed.
- Changed return values to True for better integration with server action flow.
- Added cleanup logic in setUpClass to remove existing rules before creating new ones.
- Implemented tearDownClass to ensure proper unsubscription and deletion of rules after tests.
- Improved test setup for bulk subscribe/unsubscribe actions to maintain a clean state.
- Changed assertions in bulk subscribe and unsubscribe tests to check for truthy return values instead of specific action results.
- Ensured that the state of rules is validated after performing bulk actions, maintaining consistency in test outcomes.
- Removed conditional check for existing rules before unsubscribing and unlinking.
- Ensured that cleanup actions are always executed to maintain test integrity.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants