Repository navigation
[20.0][FIX] openupgrade_framework: adapt patches to v20 - #26
Closed
FerDeNetlab wants to merge 1 commit into
Closed
FerDeNetlab wants to merge 1 commit into
FerDeNetlab wants to merge 1 commit into
Conversation
- keep the attachments of removed models: v20 added IrModel._unlink_related_attachments, which deletes them (incl. binary field data) when obsolete models are unlinked in _process_end - validate views one by one: the warning handler read xml_id/model on a multi-record recordset, raising 'Expected singleton' - also catch the errors raised after a swallowed _raise_view_error - use the cursor's savepoint helper in unlink (uuid4 was never called and savepoints were never released) - respect country_ids when auto installing modules in update_list
1 of 6 tasks
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.
Fixes for OCA#6046 found while running a full 19.0 → 20.0 migration (crm, sale_management, purchase, stock, account + l10n_mx, project, hr, mrp, point_of_sale; demo data, 131 modules):
IrModel._unlink_related_attachments(odoo/addons/base/models/ir_model.py), an@api.ondelete(at_uninstall=False)that deletes allir.attachmentrows of the model (includingattachment=Truebinary fields) and marks their files for GC. In v20 those methods are only skipped for modules inregistry.uninstalling_modules, which is still empty when_process_endruns, so every obsoleteir.modelunlinked there loses its attachments while_drop_tablekeeps the table. The patch replaces it with a logging no-op, in line with "never drop tables".ValidationErrorhandler of_check_xmlreadsself.xml_id/self.model, but_validate_module_viewsandcreate()call it on multi-record recordsets →Expected singletonaborts the upgrade instead of logging a warning._raise_view_error. As it doesn't raise anymore, validation goes on and fails withAttributeError/KeyError/NameError/ValueError(e.g._check_field_paths,_validate_domain_identifiers), which nobody caught.cr.savepoint()inunlink.str(uuid4)never calleduuid4, so all savepoints shared one name and were never released; the cursor helper also restores the ORM state on rollback.country_idswhen auto installing inupdate_list, likebutton_installdoes (otherwise e.g.account_peppolgets installed on databases without a Peppol country).With these (and migration scripts for the modules above) the test database migrates with all 1692 views valid and accounting data identical to v19.
Assisted-by: Claude Opus 5.5 (drafted with AI assistance, reviewed by me)