diff options
| author | len-odoo <len@odoo.com> | 2018-05-30 14:06:54 +0200 |
|---|---|---|
| committer | len-odoo <35492570+len-odoo@users.noreply.github.com> | 2018-06-01 13:06:09 +0200 |
| commit | 42aff92a4e1cb35af3ee90817dccc3548761d4a8 (patch) | |
| tree | e05610d59bb196015fae05a3aac184bb65e22358 /addons/account/data | |
| parent | a5ccc1b6b528d3daa2a8ae9933466803b0dbf597 (diff) | |
[FIX] account, purchase, sale: properly quote the name of the email sender
formataddr (from the email python library) writes email_from as '"name" <email>'
in the email_from field of the mail.compose.message record.
When the mail is rendered, onchange_template_id is triggered.
This then overwrites the values of email_from among other fields.
What happens is that it uses the email_from field from the template to render
the email_from, bypassing what was put by formataddr before.
What happens in some cases is that it is rendered as 'name <email>'
(note the quotes have been stripped away).
If name contains arbitrary symbols, e.g. name = 'pépé [company] <pdg>, ohlala',
then getaddresses which is supposed to parse the (name, email) pairs gets thrown
off (in particular, <pdg> will be interpreted as an email address, and many
other problems with the various special symbols).
It then gives these wrong elements as email addresses, which will usually crash
when getting non-ascii symbols (i.e. these strings don't respect the relevant
RFC for email addresses).
Closes:
https://github.com/odoo/odoo/issues/23502
https://github.com/odoo/odoo/pull/2311823118
opw 815202
opw 1824243
Diffstat (limited to 'addons/account/data')
| -rw-r--r-- | addons/account/data/mail_template_data.xml | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/account/data/mail_template_data.xml b/addons/account/data/mail_template_data.xml index 25d54c81c85..944115b47c1 100644 --- a/addons/account/data/mail_template_data.xml +++ b/addons/account/data/mail_template_data.xml @@ -7,7 +7,7 @@ <!--Email template --> <record id="email_template_edi_invoice" model="mail.template"> <field name="name">Invoicing: Invoice email</field> - <field name="email_from">${(object.user_id.email and '%s <%s>' % (object.user_id.name, object.user_id.email) or '')|safe}</field> + <field name="email_from">${(object.user_id.email and '"%s" <%s>' % (object.user_id.name, object.user_id.email) or '')|safe}</field> <field name="subject">${object.company_id.name} Invoice (Ref ${object.number or 'n/a'})</field> <field name="partner_to">${object.partner_id.id}</field> <field name="model_id" ref="account.model_account_invoice"/> |
