[18.0][FIX] l10n_it_riba_oca: fix multi-company RiBa collection fees setting#5212
Open
mmircoli-nexapp wants to merge 1 commit into
Open
[18.0][FIX] l10n_it_riba_oca: fix multi-company RiBa collection fees setting#5212mmircoli-nexapp wants to merge 1 commit into
mmircoli-nexapp wants to merge 1 commit into
Conversation
The `default_get` override in `ResConfigSettings` always reads `due_cost_service_id` from `self.env.user.company_id` instead of the company selected in the settings form (`company_id`). This causes the RiBa collection fees setting to not persist correctly in multi-company environments: the value displayed comes from the user's main company, not the company being configured. The `related='company_id.due_cost_service_id'` field already handles reading and writing to the correct company. The `default_get` override is a legacy pattern that is no longer needed and actively breaks multi-company behavior. Remove the `default_get` override entirely.
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.
Description
Fixes #5211
The
default_getoverride inResConfigSettingsreadsdue_cost_service_idfromself.env.user.company_idinstead of thecompany_idon the settings form. This causes the RiBa collection fees setting to not persist correctly in multi-company environments.Changes
default_getoverride fromResConfigSettingsinmodels/account_config.pyapiimportThe
related="company_id.due_cost_service_id"field withreadonly=Falsealready handles reading from and writing to the correct company. Thedefault_getoverride was a legacy pattern that is no longer needed and actively breaks multi-company behavior.Checklist