T3358-Communication-config-creation - #2130
Open
loris-fab wants to merge 1 commit into
Open
Conversation
_compute_display_name concatenated config_id.name and lang directly, which are still empty on a new record. Adding a line in the editable revisions list of the communication config raised a TypeError.
There was a problem hiding this comment.
Pull request overview
Fixes an Odoo onchange crash (RPC_ERROR) when creating/editing a communication config revision by making the revision’s computed display_name resilient to unset config_id and lang values during new-record snapshots.
Changes:
- Update
_compute_display_nameto fall back to a translatable"New"whenconfig_id.nameis not yet set. - Append the language suffix only when
langhas a value, avoiding type errors on brand-new revisions.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Goal
Creating or editing a communication config (communication rule) threw an
RPC_ERRORduring the onchange, blocking the UI and preventing the record from being saved.Technical aspect
partner_communication_revision/models/communication_revision.py:_compute_display_nameconcatenatedconfig_id.nameandlangdirectly. On a brand new revision, the record the web client snapshots for the onchange , both are stillFalse, henceTypeError: unsupported operand type(s) for +: 'bool' and 'str'.langhas a value. The displayed name is unchanged once both fields are filled.editable="bottom"in the config form (views/communication_config_view.xml), so every line added there went through this path.Misc
No misc