Fix/473 quarantine noupdate - #479
Open
LunarCapsule127 wants to merge 4 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why is this change needed?
data/quarantine_cron.xmldeclared two crons and two config params in a plain<odoo>block with nonoupdate, so every module upgrade rewrote all four to the shipped defaults. An admin who tuned a retention window, changed a cron interval, or deliberately disabled a cron got silently reset on the next upgrade.Split out of the #470 review, which fixed the same defect in
scan_sweep_cron.xml.Fixes #473.
How was the change implemented?
quarantine_cron.xmlin<odoo noupdate="1">.migrations/19.0.2.2.0/post-migrate.py, since the loader only honorsnoupdateat record-creation time; on databases that already installed the module, the fourir.model.datarows exist withnoupdate = Falseand the XML change alone would not flip them. The migration setsnoupdate = TRUEon those rows and leaves the stored values untouched, so tuned values survive and untouched defaults stay as shipped.19.0.2.2.0so the migration runs.New unit tests
None added; extended the existing regression test.
Unit tests executed by the author
No local environment; relying on repository CI to run
spp_attachment_av_scantests on this PR.How to test manually
spp_attachment_av_scan.quarantine_retention_daysto 30) or disable one of the crons.Related links