Skip to content

T2480 sender signature - #2208

Open
danpa32 wants to merge 2 commits into
18.0from
T2480-sender-signature
Open

danpa32 wants to merge 2 commits into
18.0from
T2480-sender-signature

Conversation

@danpa32

@danpa32 danpa32 commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

[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

  • 130 of the 264 communication templates use the sender's signature, so this is not limited to "Default communication".
  • "Default communication" alone is used about 170 to 270 times a month (May to October 2026).

Reproduce

  1. Contacts → Partner Communication → Communication Jobs → New.
  2. Template "Default communication", any sponsor as partner, sender A, send mode by e-mail. Save: the text ends with A's signature.
  3. Change the sender to B and save: the text still ends with A's signature.
  4. Click "Refresh": B's signature, but the text is generated again from the template.

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)

  • When the sender of a communication changes, the old sender's signature in the text is replaced by the new sender's signature. The rest of the text, including what was written by hand, is kept.
  • It works when the text was edited and the sender changed in the same save: the text editor rewrites the HTML, so the signature is then found by its text.
  • If the old signature is no longer in the text (removed or changed by hand, or a letter by post, which has no signature), the text is left as it is.
  • In the form, the signature changes as soon as the sender is changed, before saving (also when the sender is changed several times in a row). Changes made outside the form (code, imports) are handled when saved.
  • Tests: 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.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant