Repository navigation
Conversation
Changing the sender of a communication kept the previous sender's signature at the end of the text. The signature is now replaced as soon as the sender changes in the form (and on save for other changes), keeping the rest of the text written by hand. If the old signature is no longer in the text, the text is left unchanged.
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.
[T2480] Changing the sender of a communication does not change the signature
Where it is
Contacts → Partner Communication → Communication Jobs → open a communication (the screenshot is the form of a communication job, here with the template "Default communication", sent by e-mail). On the left: template, sender (field "user_id"), partner. Below: subject and text. A "Refresh" button is at the top right of the form.
What happens
The text of a communication, including the signature at the end, is generated once, when the communication is created, from its template. The template puts the sender's signature at the end.
Changing the sender afterwards only changes the sender field. The text is generated again only when the template or the records change, not the sender. So the signature of the first sender stays.
The signature cannot be deleted with Backspace because it is made of tables, and the Odoo text editor does not remove a table that way. It has to be removed with the table menu (click inside it, then delete table), and it is several tables nested in each other.
The "Refresh" button generates the text again with the new sender's signature, but it also replaces anything written by hand in the text.
Scope
Reproduce
Checked the same way in a script on Odoo 18 (no data kept).
Workaround today
Change the sender first, click "Refresh", then write the text.
Proposed fix
When the sender of a communication changes (form or save), replace the old sender's signature in the text with the new sender's signature, and keep the rest of the text as it is. If the old signature is not found in the text (removed or edited by hand), leave the text unchanged. Module: partner_communication (compassion-modules), with a test.
Change (partner_communication, compassion-modules)
tests/test_sender_signature.py(sender change, text edited in the editor, signature removed by hand, sender changed in the form A → B → C before saving). Also checked with the real "Default communication" template and two staff members.Manual test
Contacts → Partner Communication → Communication Jobs → open a pending communication sent by e-mail (or create one with "Default communication"). Write something in the text, then change the sender: the signature at the end becomes the new sender's right away and the text written is kept. Do not use "Refresh": it rebuilds the whole text from the template.