Commit Graph
29 Commits
Author SHA1 Message Date
Christophe Simonis aba8c2b8fb [MERGE] forward port branch 11.0 up to 1b272a2050 2018-06-05 16:27:49 +02:00
len-odoo 42aff92a4e [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
2018-06-01 13:06:09 +02:00
Christophe Simonis 3ab25b60bc [MERGE] forward port branch saas-15 up to cae950e826 2018-04-23 17:59:59 +02:00
Christophe Simonis 6b94555af0 [MERGE] forward port branch saas-14 up to dd18811e6c 2018-04-23 16:00:32 +02:00
Nicolas Lempereur dd18811e6c [FIX] purchase: use PO company for PO notification
In 41ffb503 the "Invoice Notification Email"  and "Sale Order
Notification Email" were modified so the company used was the one of
the object if available or the sender otherwise.

This had not been done for the "Purchase Order Notification Email" which
was added in saas-14 which might be unexpected.

Also as in 7a03f9ce9 specify the company when displaying the logo.

opw-1838112
closes #24344
2018-04-23 15:31:52 +02:00
Goffin Simon 4ac10f20c4 [FIX] account, purchase, sale: Wrong company displayed in the footer
Steps to reproduce the bug:

- Set a multi company environment with two company A and B
- Set user admin in company A
- Set user demo in company B
- Create a PO with user demo
- Send a RFQ

Bug:

The company of the admin user was displayed in the footer of the email.

The function _notify called on res.parter model is called in sudo by
the function _notify on mail.message model.

The function render_template on mail.template model uses the user defined
on self.env to render the template. So the user admin was always used.

opw:1835647
2018-04-23 09:33:22 +02:00
Christophe Simonis e0345a4a3f [MERGE] forward port branch 11.0 up to 2835d29979 2018-03-20 11:45:11 +01:00
Christophe Simonis 4715d7e35a [MERGE] forward port branch saas-15 up to 0d55241185 2018-03-19 19:29:58 +01:00
Christophe Simonis 82effcca83 [MERGE] forward port branch 10.0 up to caf6b4a7c7 2018-03-19 18:25:41 +01:00
jem-odoo 622b70ee3e [FIX] purchase: wrong condition in mail template
Before checking the first element of
'partner_id.child_ids', rather check that
the partner and not the object has children,
to avoid crashes when the partner of the PO
is a company.
opw-1826359
2018-03-19 15:13:33 +00:00
Christophe Simonis 36945a5853 [MERGE] forward port branch 11.0 up to c2e878e34c 2018-03-01 19:43:25 +01:00
Christophe Simonis 9d25cc3429 [FIX] *: correcly format amounts in mail templates 2018-02-28 19:01:35 +01:00
Thibault Delavallée 885e7fcda9 [REF] various: use secondary notification template
All those templates are basically the same except some bug fixes that
were not propagated about company. Let us use just the one we just
defined in the mail module.
2018-01-29 16:56:04 +01:00
Thibault Delavallée 0f301bec25 [REF] mail: move email notification templates to QWeb
In this commit we change notification templates used to render
notification emails from jinja-based mail.template to pure QWeb
templates.

There are several reasons to do so

 * those are not real mail.template records. Indeed they cannot be used
   outside of the notification process as some values are computed
   and not available on the mail.message record used to render the
   template;
 * we do not really need other fields than body. Indeed fields like
   subject, email_from or email_to are computed from the notification
   process;
 * we do not want people to update the mail.template without knowing
   the consequences, especially for fields like recipients that may
   broke the mail gateway;
 * using the html editor easily break the mail.template as it is very
   custom and very to break without really realizing it.

It also simplifies template management as it lessens number of mail
template people have in their list view of mail.template. It avoids
mixing technical and functional templates.

We move to QWeb templates as those are not too hard to customize and
allow to perform body rendering which is what we really need when
notifying people of a new message.

This commit does not change the functional purpose and layout of the
templates. Behavior should be the same before and after this commit.
2018-01-29 16:48:23 +01:00
Nicolas Martinelli ee8e3d6940 [FIX] account, l10n_be_invoice_bba, purchase, repair, sale: format_amount
Use `format_amount` in the mail templates in order to format as a
regular amount (with rounding and symbol).

opw-805370
2018-01-25 11:00:35 +01:00
Fabien Pinckaers 752e4f566b [IMP] purchase: RfQ email layout improved 2016-12-22 17:30:34 +01:00
Fabien Pinckaers a86babf447 [FIX] purchase: missing signature on RFQ's emails 2016-12-22 17:30:34 +01:00
Denis Vermylen (dve) ba3d3582bc [MIG] purchase: Migrate to new API 2016-08-05 14:04:37 +02:00
Fabien Pinckaers 6ff1c28fb3 [IMP] purchase: improved email template 2016-07-17 23:55:30 +02:00
Fabien Pinckaers 97e2d35292 [FIX] english typo: amounting 00 --> amounting in 00 2016-03-21 20:48:39 -07:00
Ravi Gohil 7eab8e26d3 [MIGR] base: migrate base/res to the new API
- `ir.property`, improve API of method `get_by_record`
- `res.bank`, `res.partner.bank`
- `res.company`
- `res.config`, `res.config.installer`, `res.config.settings`, fix usage of methods `get_default_`
- `res.country`, `res.country.group`, `res.country.state`
- `res.currency`, `res.currency.rate`
- `res.font`
- `res.lang`
- `res.partner`, `res.partner.category`, `res.partner.title`
- `res.request.link`
- `res.groups`, `res.users`, `res.users.log`, change password wizard
2016-02-23 12:06:25 +01:00
Julien Legros e5e7c4c121 [MERGE] forward port of branch 9.0 up to 6872aae 2016-01-25 11:26:27 +01:00
Nicolas Lempereur b395ade078 [IMP] *: unnecessary safe filter for subject template
With 6dde919 email subject field are not autoescaped by default, thus
using safe is not necessary.

closes #10547
2016-01-20 14:14:38 +01:00
Daniel Dico d8e5cdec7d [FIX] fix various Lucida misspellings
closes #9997
2015-12-10 09:55:22 +01:00
Christophe Simonis 4022493c0b [MERGE] forward port of branch 9.0 up to da2b88b 2015-12-09 16:44:05 +01:00
Thibault Delavallée da2b88bbbe [FIX] sale and others: email_from of templates 2015-12-09 09:59:04 +01:00
Thibault Delavallée 7fe9d58b0d [IMP] invoice, sale, purchase: template update
Templates used to send invoice / quotation / PO by email are cleaned. Custom
style is removed. Content is simplified.

For sale, only one template is kept through the various addons. Previously to
this commit there are 3 templates: standard, portal and online quote. Those
template are similar except the link to get the sale order. Now the base template
contains some logic that should be sufficient to cover all cases. This breaks
the modular approach but is easier to use for users. As templates are still mako
it is not possible to use inheritance. So having a base template knowing some bits
of overriding modules is necessary if we want to avoid having the same template
duplicated.
2015-11-02 11:51:09 +01:00
Yannick Tivisse 757ababa68 [FIX] account,sale,purchase: Take country format address in email templates
In qweb reports, the address is displayed according the standards of the
country where it belongs. In the email templates, the company address was
always displayed in the same way, no matter the country of the address.
2015-09-30 16:45:22 +02:00
mdi-odoo 620bf116d8 [IMP] sale, purchase: the return of mail.template (Sale order, and purchase RFQ)
These templates were deleted with c04065abd8 but there xml_id were still used in the code. Mail template are good for people, so we make them come back from the dead ...
2015-09-08 16:57:51 +02:00