From b697474be5ceabee3c913339320f393e8eb0e8b7 Mon Sep 17 00:00:00 2001 From: Simone Orsi Date: Fri, 12 Jan 2018 17:13:44 +0100 Subject: [PATCH] [fix] mail_digest: move `template_id` to `digest_template_id` When creating digest records within the context of mail composer (and possibly other contexts) you'll have a `default_template_id` key in the context which is going to override our safe default. This is going to break email generation because the template will be completely wrong and unpredictable. Lesson learned :) --- mail_digest/i18n/am.po | 2 +- mail_digest/i18n/ar.po | 2 +- mail_digest/i18n/bg.po | 2 +- mail_digest/i18n/bs.po | 2 +- mail_digest/i18n/ca.po | 2 +- mail_digest/i18n/ca_ES.po | 2 +- mail_digest/i18n/cs.po | 2 +- mail_digest/i18n/da.po | 2 +- mail_digest/i18n/de.po | 2 +- mail_digest/i18n/el_GR.po | 2 +- mail_digest/i18n/en_GB.po | 2 +- mail_digest/i18n/es.po | 2 +- mail_digest/i18n/es_AR.po | 2 +- mail_digest/i18n/es_CL.po | 2 +- mail_digest/i18n/es_CO.po | 2 +- mail_digest/i18n/es_CR.po | 2 +- mail_digest/i18n/es_DO.po | 2 +- mail_digest/i18n/es_EC.po | 2 +- mail_digest/i18n/es_ES.po | 2 +- mail_digest/i18n/es_MX.po | 2 +- mail_digest/i18n/es_PE.po | 2 +- mail_digest/i18n/es_PY.po | 2 +- mail_digest/i18n/es_VE.po | 2 +- mail_digest/i18n/et.po | 2 +- mail_digest/i18n/eu.po | 2 +- mail_digest/i18n/fa.po | 2 +- mail_digest/i18n/fi.po | 2 +- mail_digest/i18n/fr.po | 2 +- mail_digest/i18n/fr_CA.po | 2 +- mail_digest/i18n/fr_CH.po | 2 +- mail_digest/i18n/gl.po | 2 +- mail_digest/i18n/gl_ES.po | 2 +- mail_digest/i18n/he.po | 2 +- mail_digest/i18n/hr.po | 2 +- mail_digest/i18n/hr_HR.po | 2 +- mail_digest/i18n/hu.po | 2 +- mail_digest/i18n/id.po | 2 +- mail_digest/i18n/it.po | 2 +- mail_digest/i18n/ja.po | 2 +- mail_digest/i18n/ko.po | 2 +- mail_digest/i18n/lt.po | 2 +- mail_digest/i18n/lt_LT.po | 2 +- mail_digest/i18n/lv.po | 2 +- mail_digest/i18n/mail_digest.pot | 2 +- mail_digest/i18n/mk.po | 2 +- mail_digest/i18n/mn.po | 2 +- mail_digest/i18n/nb.po | 2 +- mail_digest/i18n/nb_NO.po | 2 +- mail_digest/i18n/nl.po | 2 +- mail_digest/i18n/nl_BE.po | 2 +- mail_digest/i18n/nl_NL.po | 2 +- mail_digest/i18n/pl.po | 2 +- mail_digest/i18n/pt.po | 2 +- mail_digest/i18n/pt_BR.po | 2 +- mail_digest/i18n/pt_PT.po | 2 +- mail_digest/i18n/ro.po | 2 +- mail_digest/i18n/ru.po | 2 +- mail_digest/i18n/sk.po | 2 +- mail_digest/i18n/sl.po | 2 +- mail_digest/i18n/sr.po | 2 +- mail_digest/i18n/sr@latin.po | 2 +- mail_digest/i18n/sv.po | 2 +- mail_digest/i18n/th.po | 2 +- mail_digest/i18n/tr.po | 2 +- mail_digest/i18n/tr_TR.po | 2 +- mail_digest/i18n/uk.po | 2 +- mail_digest/i18n/vi.po | 2 +- mail_digest/i18n/vi_VN.po | 2 +- mail_digest/i18n/zh_CN.po | 2 +- mail_digest/i18n/zh_TW.po | 2 +- mail_digest/models/mail_digest.py | 15 +++++++++++---- mail_digest/tests/test_digest.py | 4 ++-- mail_digest/views/mail_digest_views.xml | 2 +- 73 files changed, 84 insertions(+), 77 deletions(-) diff --git a/mail_digest/i18n/am.po b/mail_digest/i18n/am.po index 9a79bf9d..b61e3251 100644 --- a/mail_digest/i18n/am.po +++ b/mail_digest/i18n/am.po @@ -167,7 +167,7 @@ msgid "Partner notification configuration" msgstr "" #. module: mail_digest -#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_template_id +#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_digest_template_id msgid "Qweb mail template" msgstr "" diff --git a/mail_digest/i18n/ar.po b/mail_digest/i18n/ar.po index c2211bf9..2c053e30 100644 --- a/mail_digest/i18n/ar.po +++ b/mail_digest/i18n/ar.po @@ -168,7 +168,7 @@ msgid "Partner notification configuration" msgstr "" #. module: mail_digest -#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_template_id +#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_digest_template_id msgid "Qweb mail template" msgstr "" diff --git a/mail_digest/i18n/bg.po b/mail_digest/i18n/bg.po index ebad59a5..7a504543 100644 --- a/mail_digest/i18n/bg.po +++ b/mail_digest/i18n/bg.po @@ -167,7 +167,7 @@ msgid "Partner notification configuration" msgstr "" #. module: mail_digest -#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_template_id +#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_digest_template_id msgid "Qweb mail template" msgstr "" diff --git a/mail_digest/i18n/bs.po b/mail_digest/i18n/bs.po index aeb38f2c..2a22e2c2 100644 --- a/mail_digest/i18n/bs.po +++ b/mail_digest/i18n/bs.po @@ -168,7 +168,7 @@ msgid "Partner notification configuration" msgstr "" #. module: mail_digest -#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_template_id +#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_digest_template_id msgid "Qweb mail template" msgstr "" diff --git a/mail_digest/i18n/ca.po b/mail_digest/i18n/ca.po index 2f30ffb9..7373071c 100644 --- a/mail_digest/i18n/ca.po +++ b/mail_digest/i18n/ca.po @@ -168,7 +168,7 @@ msgid "Partner notification configuration" msgstr "" #. module: mail_digest -#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_template_id +#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_digest_template_id msgid "Qweb mail template" msgstr "" diff --git a/mail_digest/i18n/ca_ES.po b/mail_digest/i18n/ca_ES.po index f0673241..067b518f 100644 --- a/mail_digest/i18n/ca_ES.po +++ b/mail_digest/i18n/ca_ES.po @@ -168,7 +168,7 @@ msgid "Partner notification configuration" msgstr "" #. module: mail_digest -#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_template_id +#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_digest_template_id msgid "Qweb mail template" msgstr "" diff --git a/mail_digest/i18n/cs.po b/mail_digest/i18n/cs.po index 77ed97dc..e4e13802 100644 --- a/mail_digest/i18n/cs.po +++ b/mail_digest/i18n/cs.po @@ -167,7 +167,7 @@ msgid "Partner notification configuration" msgstr "" #. module: mail_digest -#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_template_id +#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_digest_template_id msgid "Qweb mail template" msgstr "" diff --git a/mail_digest/i18n/da.po b/mail_digest/i18n/da.po index 07889efa..53acfa48 100644 --- a/mail_digest/i18n/da.po +++ b/mail_digest/i18n/da.po @@ -167,7 +167,7 @@ msgid "Partner notification configuration" msgstr "" #. module: mail_digest -#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_template_id +#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_digest_template_id msgid "Qweb mail template" msgstr "" diff --git a/mail_digest/i18n/de.po b/mail_digest/i18n/de.po index 3e574037..f5fecab5 100644 --- a/mail_digest/i18n/de.po +++ b/mail_digest/i18n/de.po @@ -168,7 +168,7 @@ msgid "Partner notification configuration" msgstr "Partner notification configuration" #. module: mail_digest -#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_template_id +#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_digest_template_id msgid "Qweb mail template" msgstr "" diff --git a/mail_digest/i18n/el_GR.po b/mail_digest/i18n/el_GR.po index 1935fbbd..0612cf59 100644 --- a/mail_digest/i18n/el_GR.po +++ b/mail_digest/i18n/el_GR.po @@ -169,7 +169,7 @@ msgid "Partner notification configuration" msgstr "" #. module: mail_digest -#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_template_id +#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_digest_template_id msgid "Qweb mail template" msgstr "" diff --git a/mail_digest/i18n/en_GB.po b/mail_digest/i18n/en_GB.po index a163e92e..602b9fe6 100644 --- a/mail_digest/i18n/en_GB.po +++ b/mail_digest/i18n/en_GB.po @@ -168,7 +168,7 @@ msgid "Partner notification configuration" msgstr "" #. module: mail_digest -#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_template_id +#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_digest_template_id msgid "Qweb mail template" msgstr "" diff --git a/mail_digest/i18n/es.po b/mail_digest/i18n/es.po index c51c5829..b637373a 100644 --- a/mail_digest/i18n/es.po +++ b/mail_digest/i18n/es.po @@ -169,7 +169,7 @@ msgid "Partner notification configuration" msgstr "" #. module: mail_digest -#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_template_id +#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_digest_template_id msgid "Qweb mail template" msgstr "" diff --git a/mail_digest/i18n/es_AR.po b/mail_digest/i18n/es_AR.po index fd797b78..c67f9487 100644 --- a/mail_digest/i18n/es_AR.po +++ b/mail_digest/i18n/es_AR.po @@ -168,7 +168,7 @@ msgid "Partner notification configuration" msgstr "" #. module: mail_digest -#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_template_id +#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_digest_template_id msgid "Qweb mail template" msgstr "" diff --git a/mail_digest/i18n/es_CL.po b/mail_digest/i18n/es_CL.po index 65b2e648..7ec03e75 100644 --- a/mail_digest/i18n/es_CL.po +++ b/mail_digest/i18n/es_CL.po @@ -168,7 +168,7 @@ msgid "Partner notification configuration" msgstr "" #. module: mail_digest -#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_template_id +#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_digest_template_id msgid "Qweb mail template" msgstr "" diff --git a/mail_digest/i18n/es_CO.po b/mail_digest/i18n/es_CO.po index 2edd7b64..a278b029 100644 --- a/mail_digest/i18n/es_CO.po +++ b/mail_digest/i18n/es_CO.po @@ -168,7 +168,7 @@ msgid "Partner notification configuration" msgstr "" #. module: mail_digest -#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_template_id +#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_digest_template_id msgid "Qweb mail template" msgstr "" diff --git a/mail_digest/i18n/es_CR.po b/mail_digest/i18n/es_CR.po index 92f912da..d30768a9 100644 --- a/mail_digest/i18n/es_CR.po +++ b/mail_digest/i18n/es_CR.po @@ -168,7 +168,7 @@ msgid "Partner notification configuration" msgstr "" #. module: mail_digest -#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_template_id +#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_digest_template_id msgid "Qweb mail template" msgstr "" diff --git a/mail_digest/i18n/es_DO.po b/mail_digest/i18n/es_DO.po index 6315b7c6..d56ae077 100644 --- a/mail_digest/i18n/es_DO.po +++ b/mail_digest/i18n/es_DO.po @@ -168,7 +168,7 @@ msgid "Partner notification configuration" msgstr "" #. module: mail_digest -#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_template_id +#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_digest_template_id msgid "Qweb mail template" msgstr "" diff --git a/mail_digest/i18n/es_EC.po b/mail_digest/i18n/es_EC.po index 17e34982..1ec9b3de 100644 --- a/mail_digest/i18n/es_EC.po +++ b/mail_digest/i18n/es_EC.po @@ -168,7 +168,7 @@ msgid "Partner notification configuration" msgstr "" #. module: mail_digest -#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_template_id +#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_digest_template_id msgid "Qweb mail template" msgstr "" diff --git a/mail_digest/i18n/es_ES.po b/mail_digest/i18n/es_ES.po index 8b7774d1..619d683a 100644 --- a/mail_digest/i18n/es_ES.po +++ b/mail_digest/i18n/es_ES.po @@ -168,7 +168,7 @@ msgid "Partner notification configuration" msgstr "" #. module: mail_digest -#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_template_id +#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_digest_template_id msgid "Qweb mail template" msgstr "" diff --git a/mail_digest/i18n/es_MX.po b/mail_digest/i18n/es_MX.po index 55b50bdb..e5c5a2bf 100644 --- a/mail_digest/i18n/es_MX.po +++ b/mail_digest/i18n/es_MX.po @@ -169,7 +169,7 @@ msgid "Partner notification configuration" msgstr "" #. module: mail_digest -#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_template_id +#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_digest_template_id msgid "Qweb mail template" msgstr "" diff --git a/mail_digest/i18n/es_PE.po b/mail_digest/i18n/es_PE.po index 1e8ecc54..d47eb720 100644 --- a/mail_digest/i18n/es_PE.po +++ b/mail_digest/i18n/es_PE.po @@ -168,7 +168,7 @@ msgid "Partner notification configuration" msgstr "" #. module: mail_digest -#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_template_id +#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_digest_template_id msgid "Qweb mail template" msgstr "" diff --git a/mail_digest/i18n/es_PY.po b/mail_digest/i18n/es_PY.po index dc334137..82b42ee3 100644 --- a/mail_digest/i18n/es_PY.po +++ b/mail_digest/i18n/es_PY.po @@ -168,7 +168,7 @@ msgid "Partner notification configuration" msgstr "" #. module: mail_digest -#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_template_id +#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_digest_template_id msgid "Qweb mail template" msgstr "" diff --git a/mail_digest/i18n/es_VE.po b/mail_digest/i18n/es_VE.po index 9f13f490..2d34d898 100644 --- a/mail_digest/i18n/es_VE.po +++ b/mail_digest/i18n/es_VE.po @@ -168,7 +168,7 @@ msgid "Partner notification configuration" msgstr "" #. module: mail_digest -#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_template_id +#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_digest_template_id msgid "Qweb mail template" msgstr "" diff --git a/mail_digest/i18n/et.po b/mail_digest/i18n/et.po index 13d23f17..e22f97f7 100644 --- a/mail_digest/i18n/et.po +++ b/mail_digest/i18n/et.po @@ -167,7 +167,7 @@ msgid "Partner notification configuration" msgstr "" #. module: mail_digest -#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_template_id +#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_digest_template_id msgid "Qweb mail template" msgstr "" diff --git a/mail_digest/i18n/eu.po b/mail_digest/i18n/eu.po index 7cd85722..b5f60d07 100644 --- a/mail_digest/i18n/eu.po +++ b/mail_digest/i18n/eu.po @@ -167,7 +167,7 @@ msgid "Partner notification configuration" msgstr "" #. module: mail_digest -#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_template_id +#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_digest_template_id msgid "Qweb mail template" msgstr "" diff --git a/mail_digest/i18n/fa.po b/mail_digest/i18n/fa.po index e6189a8b..ae83fcc6 100644 --- a/mail_digest/i18n/fa.po +++ b/mail_digest/i18n/fa.po @@ -167,7 +167,7 @@ msgid "Partner notification configuration" msgstr "" #. module: mail_digest -#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_template_id +#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_digest_template_id msgid "Qweb mail template" msgstr "" diff --git a/mail_digest/i18n/fi.po b/mail_digest/i18n/fi.po index 30115476..5e8f6e20 100644 --- a/mail_digest/i18n/fi.po +++ b/mail_digest/i18n/fi.po @@ -169,7 +169,7 @@ msgid "Partner notification configuration" msgstr "" #. module: mail_digest -#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_template_id +#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_digest_template_id msgid "Qweb mail template" msgstr "" diff --git a/mail_digest/i18n/fr.po b/mail_digest/i18n/fr.po index 49844327..7ade3b90 100644 --- a/mail_digest/i18n/fr.po +++ b/mail_digest/i18n/fr.po @@ -168,7 +168,7 @@ msgid "Partner notification configuration" msgstr "Configuration de la notification du partenaire" #. module: mail_digest -#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_template_id +#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_digest_template_id msgid "Qweb mail template" msgstr "Modèle de mail" diff --git a/mail_digest/i18n/fr_CA.po b/mail_digest/i18n/fr_CA.po index 82075eee..0e375099 100644 --- a/mail_digest/i18n/fr_CA.po +++ b/mail_digest/i18n/fr_CA.po @@ -168,7 +168,7 @@ msgid "Partner notification configuration" msgstr "" #. module: mail_digest -#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_template_id +#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_digest_template_id msgid "Qweb mail template" msgstr "" diff --git a/mail_digest/i18n/fr_CH.po b/mail_digest/i18n/fr_CH.po index 93258e57..d87ef610 100644 --- a/mail_digest/i18n/fr_CH.po +++ b/mail_digest/i18n/fr_CH.po @@ -168,7 +168,7 @@ msgid "Partner notification configuration" msgstr "Configuration de la notification du partenaire" #. module: mail_digest -#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_template_id +#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_digest_template_id msgid "Qweb mail template" msgstr "Modèle de mail" diff --git a/mail_digest/i18n/gl.po b/mail_digest/i18n/gl.po index fe5457d1..1a945eaf 100644 --- a/mail_digest/i18n/gl.po +++ b/mail_digest/i18n/gl.po @@ -168,7 +168,7 @@ msgid "Partner notification configuration" msgstr "" #. module: mail_digest -#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_template_id +#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_digest_template_id msgid "Qweb mail template" msgstr "" diff --git a/mail_digest/i18n/gl_ES.po b/mail_digest/i18n/gl_ES.po index c3a7e050..fa5aca8e 100644 --- a/mail_digest/i18n/gl_ES.po +++ b/mail_digest/i18n/gl_ES.po @@ -168,7 +168,7 @@ msgid "Partner notification configuration" msgstr "" #. module: mail_digest -#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_template_id +#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_digest_template_id msgid "Qweb mail template" msgstr "" diff --git a/mail_digest/i18n/he.po b/mail_digest/i18n/he.po index 5718f576..c5e352ec 100644 --- a/mail_digest/i18n/he.po +++ b/mail_digest/i18n/he.po @@ -167,7 +167,7 @@ msgid "Partner notification configuration" msgstr "" #. module: mail_digest -#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_template_id +#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_digest_template_id msgid "Qweb mail template" msgstr "" diff --git a/mail_digest/i18n/hr.po b/mail_digest/i18n/hr.po index 4640b38f..c35af9d8 100644 --- a/mail_digest/i18n/hr.po +++ b/mail_digest/i18n/hr.po @@ -170,7 +170,7 @@ msgid "Partner notification configuration" msgstr "" #. module: mail_digest -#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_template_id +#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_digest_template_id msgid "Qweb mail template" msgstr "" diff --git a/mail_digest/i18n/hr_HR.po b/mail_digest/i18n/hr_HR.po index 424bb597..394d2feb 100644 --- a/mail_digest/i18n/hr_HR.po +++ b/mail_digest/i18n/hr_HR.po @@ -170,7 +170,7 @@ msgid "Partner notification configuration" msgstr "" #. module: mail_digest -#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_template_id +#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_digest_template_id msgid "Qweb mail template" msgstr "" diff --git a/mail_digest/i18n/hu.po b/mail_digest/i18n/hu.po index 0b98f117..308b0c51 100644 --- a/mail_digest/i18n/hu.po +++ b/mail_digest/i18n/hu.po @@ -167,7 +167,7 @@ msgid "Partner notification configuration" msgstr "" #. module: mail_digest -#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_template_id +#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_digest_template_id msgid "Qweb mail template" msgstr "" diff --git a/mail_digest/i18n/id.po b/mail_digest/i18n/id.po index 89b143b2..6eab89ef 100644 --- a/mail_digest/i18n/id.po +++ b/mail_digest/i18n/id.po @@ -167,7 +167,7 @@ msgid "Partner notification configuration" msgstr "" #. module: mail_digest -#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_template_id +#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_digest_template_id msgid "Qweb mail template" msgstr "" diff --git a/mail_digest/i18n/it.po b/mail_digest/i18n/it.po index 7063dc8a..df513442 100644 --- a/mail_digest/i18n/it.po +++ b/mail_digest/i18n/it.po @@ -170,7 +170,7 @@ msgid "Partner notification configuration" msgstr "Configurazione notifiche partner" #. module: mail_digest -#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_template_id +#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_digest_template_id msgid "Qweb mail template" msgstr "Qweb mail template" diff --git a/mail_digest/i18n/ja.po b/mail_digest/i18n/ja.po index 0f0cca1a..6feef618 100644 --- a/mail_digest/i18n/ja.po +++ b/mail_digest/i18n/ja.po @@ -167,7 +167,7 @@ msgid "Partner notification configuration" msgstr "" #. module: mail_digest -#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_template_id +#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_digest_template_id msgid "Qweb mail template" msgstr "" diff --git a/mail_digest/i18n/ko.po b/mail_digest/i18n/ko.po index 1ae89e0f..dbb40dd1 100644 --- a/mail_digest/i18n/ko.po +++ b/mail_digest/i18n/ko.po @@ -167,7 +167,7 @@ msgid "Partner notification configuration" msgstr "" #. module: mail_digest -#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_template_id +#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_digest_template_id msgid "Qweb mail template" msgstr "" diff --git a/mail_digest/i18n/lt.po b/mail_digest/i18n/lt.po index cb6c50ba..093c5ea2 100644 --- a/mail_digest/i18n/lt.po +++ b/mail_digest/i18n/lt.po @@ -168,7 +168,7 @@ msgid "Partner notification configuration" msgstr "" #. module: mail_digest -#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_template_id +#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_digest_template_id msgid "Qweb mail template" msgstr "" diff --git a/mail_digest/i18n/lt_LT.po b/mail_digest/i18n/lt_LT.po index b310e0a3..63d753f5 100644 --- a/mail_digest/i18n/lt_LT.po +++ b/mail_digest/i18n/lt_LT.po @@ -169,7 +169,7 @@ msgid "Partner notification configuration" msgstr "" #. module: mail_digest -#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_template_id +#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_digest_template_id msgid "Qweb mail template" msgstr "" diff --git a/mail_digest/i18n/lv.po b/mail_digest/i18n/lv.po index c7715f2d..47c7e59f 100644 --- a/mail_digest/i18n/lv.po +++ b/mail_digest/i18n/lv.po @@ -168,7 +168,7 @@ msgid "Partner notification configuration" msgstr "" #. module: mail_digest -#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_template_id +#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_digest_template_id msgid "Qweb mail template" msgstr "" diff --git a/mail_digest/i18n/mail_digest.pot b/mail_digest/i18n/mail_digest.pot index b9cf9b15..17d90a5d 100644 --- a/mail_digest/i18n/mail_digest.pot +++ b/mail_digest/i18n/mail_digest.pot @@ -164,7 +164,7 @@ msgid "Partner notification configuration" msgstr "" #. module: mail_digest -#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_template_id +#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_digest_template_id msgid "Qweb mail template" msgstr "" diff --git a/mail_digest/i18n/mk.po b/mail_digest/i18n/mk.po index e039226b..1cde0466 100644 --- a/mail_digest/i18n/mk.po +++ b/mail_digest/i18n/mk.po @@ -167,7 +167,7 @@ msgid "Partner notification configuration" msgstr "" #. module: mail_digest -#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_template_id +#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_digest_template_id msgid "Qweb mail template" msgstr "" diff --git a/mail_digest/i18n/mn.po b/mail_digest/i18n/mn.po index 9c938e64..d4c94158 100644 --- a/mail_digest/i18n/mn.po +++ b/mail_digest/i18n/mn.po @@ -167,7 +167,7 @@ msgid "Partner notification configuration" msgstr "" #. module: mail_digest -#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_template_id +#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_digest_template_id msgid "Qweb mail template" msgstr "" diff --git a/mail_digest/i18n/nb.po b/mail_digest/i18n/nb.po index 8d8cd1f5..bad501e1 100644 --- a/mail_digest/i18n/nb.po +++ b/mail_digest/i18n/nb.po @@ -168,7 +168,7 @@ msgid "Partner notification configuration" msgstr "" #. module: mail_digest -#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_template_id +#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_digest_template_id msgid "Qweb mail template" msgstr "" diff --git a/mail_digest/i18n/nb_NO.po b/mail_digest/i18n/nb_NO.po index 7c20b3e9..05589b5b 100644 --- a/mail_digest/i18n/nb_NO.po +++ b/mail_digest/i18n/nb_NO.po @@ -169,7 +169,7 @@ msgid "Partner notification configuration" msgstr "" #. module: mail_digest -#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_template_id +#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_digest_template_id msgid "Qweb mail template" msgstr "" diff --git a/mail_digest/i18n/nl.po b/mail_digest/i18n/nl.po index 2e618722..72dabb32 100644 --- a/mail_digest/i18n/nl.po +++ b/mail_digest/i18n/nl.po @@ -168,7 +168,7 @@ msgid "Partner notification configuration" msgstr "" #. module: mail_digest -#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_template_id +#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_digest_template_id msgid "Qweb mail template" msgstr "" diff --git a/mail_digest/i18n/nl_BE.po b/mail_digest/i18n/nl_BE.po index 76d3d90e..faee7f58 100644 --- a/mail_digest/i18n/nl_BE.po +++ b/mail_digest/i18n/nl_BE.po @@ -168,7 +168,7 @@ msgid "Partner notification configuration" msgstr "" #. module: mail_digest -#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_template_id +#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_digest_template_id msgid "Qweb mail template" msgstr "" diff --git a/mail_digest/i18n/nl_NL.po b/mail_digest/i18n/nl_NL.po index 2edb7247..d8fcc3a4 100644 --- a/mail_digest/i18n/nl_NL.po +++ b/mail_digest/i18n/nl_NL.po @@ -168,7 +168,7 @@ msgid "Partner notification configuration" msgstr "" #. module: mail_digest -#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_template_id +#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_digest_template_id msgid "Qweb mail template" msgstr "" diff --git a/mail_digest/i18n/pl.po b/mail_digest/i18n/pl.po index 5fccb997..da23e503 100644 --- a/mail_digest/i18n/pl.po +++ b/mail_digest/i18n/pl.po @@ -169,7 +169,7 @@ msgid "Partner notification configuration" msgstr "" #. module: mail_digest -#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_template_id +#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_digest_template_id msgid "Qweb mail template" msgstr "" diff --git a/mail_digest/i18n/pt.po b/mail_digest/i18n/pt.po index 84574185..9f79315c 100644 --- a/mail_digest/i18n/pt.po +++ b/mail_digest/i18n/pt.po @@ -167,7 +167,7 @@ msgid "Partner notification configuration" msgstr "" #. module: mail_digest -#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_template_id +#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_digest_template_id msgid "Qweb mail template" msgstr "" diff --git a/mail_digest/i18n/pt_BR.po b/mail_digest/i18n/pt_BR.po index 370c8734..4d73219a 100644 --- a/mail_digest/i18n/pt_BR.po +++ b/mail_digest/i18n/pt_BR.po @@ -169,7 +169,7 @@ msgid "Partner notification configuration" msgstr "" #. module: mail_digest -#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_template_id +#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_digest_template_id msgid "Qweb mail template" msgstr "" diff --git a/mail_digest/i18n/pt_PT.po b/mail_digest/i18n/pt_PT.po index 13393702..88abedaa 100644 --- a/mail_digest/i18n/pt_PT.po +++ b/mail_digest/i18n/pt_PT.po @@ -168,7 +168,7 @@ msgid "Partner notification configuration" msgstr "" #. module: mail_digest -#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_template_id +#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_digest_template_id msgid "Qweb mail template" msgstr "" diff --git a/mail_digest/i18n/ro.po b/mail_digest/i18n/ro.po index 8d9c9ccf..22eb7c8e 100644 --- a/mail_digest/i18n/ro.po +++ b/mail_digest/i18n/ro.po @@ -168,7 +168,7 @@ msgid "Partner notification configuration" msgstr "" #. module: mail_digest -#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_template_id +#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_digest_template_id msgid "Qweb mail template" msgstr "" diff --git a/mail_digest/i18n/ru.po b/mail_digest/i18n/ru.po index 0dd412a9..7872d3a9 100644 --- a/mail_digest/i18n/ru.po +++ b/mail_digest/i18n/ru.po @@ -169,7 +169,7 @@ msgid "Partner notification configuration" msgstr "" #. module: mail_digest -#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_template_id +#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_digest_template_id msgid "Qweb mail template" msgstr "" diff --git a/mail_digest/i18n/sk.po b/mail_digest/i18n/sk.po index 0afb3aa4..3a95a154 100644 --- a/mail_digest/i18n/sk.po +++ b/mail_digest/i18n/sk.po @@ -168,7 +168,7 @@ msgid "Partner notification configuration" msgstr "" #. module: mail_digest -#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_template_id +#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_digest_template_id msgid "Qweb mail template" msgstr "" diff --git a/mail_digest/i18n/sl.po b/mail_digest/i18n/sl.po index 5955ef5b..fa954a6f 100644 --- a/mail_digest/i18n/sl.po +++ b/mail_digest/i18n/sl.po @@ -169,7 +169,7 @@ msgid "Partner notification configuration" msgstr "" #. module: mail_digest -#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_template_id +#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_digest_template_id msgid "Qweb mail template" msgstr "" diff --git a/mail_digest/i18n/sr.po b/mail_digest/i18n/sr.po index cc02ef41..8bc6c306 100644 --- a/mail_digest/i18n/sr.po +++ b/mail_digest/i18n/sr.po @@ -168,7 +168,7 @@ msgid "Partner notification configuration" msgstr "" #. module: mail_digest -#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_template_id +#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_digest_template_id msgid "Qweb mail template" msgstr "" diff --git a/mail_digest/i18n/sr@latin.po b/mail_digest/i18n/sr@latin.po index 53ac2a0e..579c9038 100644 --- a/mail_digest/i18n/sr@latin.po +++ b/mail_digest/i18n/sr@latin.po @@ -169,7 +169,7 @@ msgid "Partner notification configuration" msgstr "" #. module: mail_digest -#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_template_id +#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_digest_template_id msgid "Qweb mail template" msgstr "" diff --git a/mail_digest/i18n/sv.po b/mail_digest/i18n/sv.po index 31c8d909..cb1620b4 100644 --- a/mail_digest/i18n/sv.po +++ b/mail_digest/i18n/sv.po @@ -167,7 +167,7 @@ msgid "Partner notification configuration" msgstr "" #. module: mail_digest -#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_template_id +#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_digest_template_id msgid "Qweb mail template" msgstr "" diff --git a/mail_digest/i18n/th.po b/mail_digest/i18n/th.po index 56f92d3d..01706cb5 100644 --- a/mail_digest/i18n/th.po +++ b/mail_digest/i18n/th.po @@ -167,7 +167,7 @@ msgid "Partner notification configuration" msgstr "" #. module: mail_digest -#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_template_id +#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_digest_template_id msgid "Qweb mail template" msgstr "" diff --git a/mail_digest/i18n/tr.po b/mail_digest/i18n/tr.po index 3cbf29bc..a7fa8f9f 100644 --- a/mail_digest/i18n/tr.po +++ b/mail_digest/i18n/tr.po @@ -167,7 +167,7 @@ msgid "Partner notification configuration" msgstr "" #. module: mail_digest -#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_template_id +#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_digest_template_id msgid "Qweb mail template" msgstr "" diff --git a/mail_digest/i18n/tr_TR.po b/mail_digest/i18n/tr_TR.po index 7495cf71..1804f27c 100644 --- a/mail_digest/i18n/tr_TR.po +++ b/mail_digest/i18n/tr_TR.po @@ -168,7 +168,7 @@ msgid "Partner notification configuration" msgstr "" #. module: mail_digest -#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_template_id +#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_digest_template_id msgid "Qweb mail template" msgstr "" diff --git a/mail_digest/i18n/uk.po b/mail_digest/i18n/uk.po index 7faddc35..6739edf4 100644 --- a/mail_digest/i18n/uk.po +++ b/mail_digest/i18n/uk.po @@ -168,7 +168,7 @@ msgid "Partner notification configuration" msgstr "" #. module: mail_digest -#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_template_id +#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_digest_template_id msgid "Qweb mail template" msgstr "" diff --git a/mail_digest/i18n/vi.po b/mail_digest/i18n/vi.po index 60591b53..9add6ba2 100644 --- a/mail_digest/i18n/vi.po +++ b/mail_digest/i18n/vi.po @@ -167,7 +167,7 @@ msgid "Partner notification configuration" msgstr "" #. module: mail_digest -#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_template_id +#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_digest_template_id msgid "Qweb mail template" msgstr "" diff --git a/mail_digest/i18n/vi_VN.po b/mail_digest/i18n/vi_VN.po index 99eee973..b68a63f0 100644 --- a/mail_digest/i18n/vi_VN.po +++ b/mail_digest/i18n/vi_VN.po @@ -168,7 +168,7 @@ msgid "Partner notification configuration" msgstr "" #. module: mail_digest -#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_template_id +#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_digest_template_id msgid "Qweb mail template" msgstr "" diff --git a/mail_digest/i18n/zh_CN.po b/mail_digest/i18n/zh_CN.po index 3be04345..60949a94 100644 --- a/mail_digest/i18n/zh_CN.po +++ b/mail_digest/i18n/zh_CN.po @@ -168,7 +168,7 @@ msgid "Partner notification configuration" msgstr "" #. module: mail_digest -#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_template_id +#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_digest_template_id msgid "Qweb mail template" msgstr "" diff --git a/mail_digest/i18n/zh_TW.po b/mail_digest/i18n/zh_TW.po index 0ef0182f..3706e822 100644 --- a/mail_digest/i18n/zh_TW.po +++ b/mail_digest/i18n/zh_TW.po @@ -168,7 +168,7 @@ msgid "Partner notification configuration" msgstr "" #. module: mail_digest -#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_template_id +#: model:ir.model.fields,field_description:mail_digest.field_mail_digest_digest_template_id msgid "Qweb mail template" msgstr "" diff --git a/mail_digest/models/mail_digest.py b/mail_digest/models/mail_digest.py index 6d670e67..9d8570ac 100644 --- a/mail_digest/models/mail_digest.py +++ b/mail_digest/models/mail_digest.py @@ -40,15 +40,22 @@ class MailDigest(models.Model): ondelete='set null', ) state = fields.Selection(related='mail_id.state', readonly=True) - template_id = fields.Many2one( + # To my future self: never ever change this field to `template_id`. + # When creating digest records within the context of mail composer + # (and possibly other contexts) you'll have a `default_template_id` + # key in the context which is going to override our safe default. + # This is going to break email generation because the template + # will be completely wrong. Lesson learned :) + digest_template_id = fields.Many2one( 'ir.ui.view', 'Qweb mail template', ondelete='set null', - default=lambda self: self._default_template_id(), + default=lambda self: self._default_digest_template_id(), domain=[('type', '=', 'qweb')], + oldname='template_id', ) - def _default_template_id(self): + def _default_digest_template_id(self): """Retrieve default template to render digest.""" return self.env.ref('mail_digest.default_digest_tmpl', raise_if_not_found=False) @@ -176,7 +183,7 @@ class MailDigest(models.Model): def _get_email_values(self, template=None): """Collect variables to create digest's mail message.""" self.ensure_one() - template = template or self.template_id + template = template or self.digest_template_id if not template: raise exceptions.UserError(_( 'You must pass a template or set one on the digest record.' diff --git a/mail_digest/tests/test_digest.py b/mail_digest/tests/test_digest.py index a362b365..879d39a0 100644 --- a/mail_digest/tests/test_digest.py +++ b/mail_digest/tests/test_digest.py @@ -181,10 +181,10 @@ class DigestCase(TransactionCase): default = self.env.ref('mail_digest.default_digest_tmpl') dig = self._create_for_partner(self.partner1) # check default - self.assertEqual(dig.template_id, default) + self.assertEqual(dig.digest_template_id, default) self.assertTrue(dig._get_email_values()) # drop template - dig.template_id = False + dig.digest_template_id = False # pass a custom one: ok self.assertTrue(dig._get_email_values(template=default)) # raise error if no template found diff --git a/mail_digest/views/mail_digest_views.xml b/mail_digest/views/mail_digest_views.xml index 23735975..61d58f41 100644 --- a/mail_digest/views/mail_digest_views.xml +++ b/mail_digest/views/mail_digest_views.xml @@ -33,7 +33,7 @@ - +