[IMP] mail_notification_history: make configurable from UI
This pull request updates the way the "Mail Notification With History" feature is enabled and managed in Odoo, shifting from a code-based configuration to a user-friendly setting in the UI. It also introduces additional translations and updates related documentation and tests.
Configuration and Feature Activation:
- The mechanism to enable mail history in notifications is now managed via a new
include_mail_historyBoolean field on their.modelmodel, configurable through the Odoo UI (Settings → Technical → Database Structure → Models), instead of a Python class variable (_mail_notification_include_history). [1] [2] [3] [4]
Documentation Updates:
- All documentation and installation instructions have been updated to reflect the new UI-based activation method, replacing references to the old class variable approach. [1] [2] [3]
Testing Adjustments:
- Tests have been refactored to set the new
include_mail_historyfield on models, instead of patching the class variable, to reflect the new configuration approach. [1] [2]
Translation and Internationalization:
- Added a German translation file (
de.po) and updated the translation template (mail_notification_with_history.pot) to include new field labels and help texts for the new feature. [1] [2] [3]
Module Manifest and File Structure:
- Updated the module manifest to include the new view for the
ir.modelform and removed obsolete code and imports related to the previous activation method. [1] [2] [3] [4]
Hi @TDu, some modules you are maintaining are being modified, check this out!
Good thing that it would be configurable through the UI. But this change, without migration script, will break the module for the one already using it :exclamation:
Hi @TDu thank you for your quick response. I added a migration script that should fix this I think. Unfortunately it requires the upgrade util - I did not find a better way to do it without it. I guess if the dependency is not wanted, I could also copy paste the env function from the upgrade utils into the upgrade script.
Also added a deprecation warning should the attribute still be set on a class. What do you think?
I just reran the pre-commit and I see that it removed the upgrade-utils from the requirements.txt. Is that to be expected?