[18.0][IMP] edi_core_oca: add backend-controlled auto-cleanup for exchange records#233
Conversation
ca3e2f9 to
90cc5e6
Compare
etobella
left a comment
There was a problem hiding this comment.
If we want to do that, we need to at least add a way to decide which records can be archived. IMO, we should add a flag on exchange type or backends for that.
e551b22 to
9d3fe03
Compare
Hey @etobella, thanks for the early review, you were too fast for me! 😄 Following @simahawk’s suggestion, I added the configuration to the edi.backend model and kept them disabled by default. |
You can still edit the cron to search for records by specific type. |
b96888d to
3183ca6
Compare
| string="Auto-archive records after (days)", | ||
| default=0, | ||
| help="Automatically archive EDI exchange records after X days. " | ||
| "Set to 0 to disable auto-archiving.", |
There was a problem hiding this comment.
SOLVED ✅
For consistency with the cron's code:
| "Set to 0 to disable auto-archiving.", | |
| "Set to <= 0 to disable auto-archiving.", |
| string="Auto-delete archived records after (days)", | ||
| default=0, | ||
| help="Automatically delete archived EDI exchange records after X days. " | ||
| "Set to 0 to disable auto-deletion.", |
There was a problem hiding this comment.
SOLVED ✅
For consistency with the cron's code:
| "Set to 0 to disable auto-deletion.", | |
| "Set to <= 0 to disable auto-deletion.", |
| <filter | ||
| string="Archived" | ||
| name="filter_archived" | ||
| domain="[('active', '=', False)]" | ||
| /> |
There was a problem hiding this comment.
SOLVED ✅
It could be useful to include filters for both active and archived records:
| <filter | |
| string="Archived" | |
| name="filter_archived" | |
| domain="[('active', '=', False)]" | |
| /> | |
| <filter | |
| string="Active" | |
| name="filter_active" | |
| domain="[('active', '=', True)]" | |
| /> | |
| <filter | |
| string="Archived" | |
| name="filter_archived" | |
| domain="[('active', '!=', True)]" | |
| /> |
…records Add configurable auto-archiving and auto-deletion of EDI exchange records per backend. This backend-specific settings that can be managed individually. Changes: - Add "Auto Cleanup" tab in backend form view for easy configuration - Add archive cron job that respect backend-specific retention policies - Add delete cron job that respect backend-specific retention policies - Add "Archived" filter to exchange record search view Benefits: - Each backend can have different retention policies - Setting fields to 0 (default value) disables the respective cleanup behavior - More flexible data retention management - Better control over storage and performance optimization The cron jobs iterate through backends with configured retention settings, applying appropriate cutoff values. chore(edi_core_oca): update documentation
3183ca6 to
0d91f71
Compare
|
@etobella ping :) |
|
This PR has the |
|
/ocabot merge patch |
|
What a great day to merge this nice PR. Let's do it! |
|
Congratulations, your PR was merged at a82ba97. Thanks a lot for contributing to OCA. ❤️ |
This pull request introduces automated maintenance for EDI exchange records. The most significant changes are the addition of scheduled jobs to archive and delete old EDI records and the introduction of an
activeflag for EDI records.Changes:
Benefits:
The cron jobs iterate through backends with configured retention
settings, applying appropriate cutoff values.