[FIX] pms_api_rest: allow module data loads to write on the various partner#106
Open
DarioLodeiros wants to merge 1 commit into
Open
[FIX] pms_api_rest: allow module data loads to write on the various partner#106DarioLodeiros wants to merge 1 commit into
DarioLodeiros wants to merge 1 commit into
Conversation
…artner The various-partner guard (1cc158f) blocks every write on protected fields, including writes performed by module XML data loading. On a fresh install, pms_l10n_es_sii sets aeat_anonymous_cash_customer on pms.various_pms_partner from data/pms_data.xml, so the registry fails to load and the database cannot be initialized. Existing databases never hit this because that record is noupdate and was written before the guard existed. Bypass the guard when install_mode is set in the context, which BaseModel._load_records only sets during module install/upgrade data loading. Runtime writes coming from the REST API or the UI remain blocked.
Diff CoverageDiff: origin/16.0...HEAD, staged and unstaged changes
Summary
|
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.
Problem
The various-partner write guard introduced in 1cc158f blocks every write on protected fields of
pms.various_pms_partner, including writes performed by module XML data loading.On a fresh install (new database with the full addon set),
pms_l10n_es_siisetsaeat_anonymous_cash_customeron that partner from itsdata/pms_data.xml:The registry fails to load and the database cannot be initialized at all.
Existing databases never hit this because that record is
noupdate="1"and was written before the guard existed — the bug only surfaces on new deployments (e.g. self-hosted installs reproducing our addons tree).Fix
Bypass the guard when
install_modeis set in the context, whichBaseModel._load_recordsonly sets during module install/upgrade data loading. Runtime writes coming from the REST API or the UI remain blocked, which is what the guard was added for.Includes a regression test.
🤖 Generated with Claude Code