Browse Source

[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 :)
pull/187/head
Simone Orsi 7 years ago
parent
commit
854619f7c5
  1. 2
      mail_digest/i18n/am.po
  2. 2
      mail_digest/i18n/ar.po
  3. 2
      mail_digest/i18n/bg.po
  4. 2
      mail_digest/i18n/bs.po
  5. 2
      mail_digest/i18n/ca.po
  6. 2
      mail_digest/i18n/ca_ES.po
  7. 2
      mail_digest/i18n/cs.po
  8. 2
      mail_digest/i18n/da.po
  9. 2
      mail_digest/i18n/de.po
  10. 2
      mail_digest/i18n/el_GR.po
  11. 2
      mail_digest/i18n/en_GB.po
  12. 2
      mail_digest/i18n/es.po
  13. 2
      mail_digest/i18n/es_AR.po
  14. 2
      mail_digest/i18n/es_CL.po
  15. 2
      mail_digest/i18n/es_CO.po
  16. 2
      mail_digest/i18n/es_CR.po
  17. 2
      mail_digest/i18n/es_DO.po
  18. 2
      mail_digest/i18n/es_EC.po
  19. 2
      mail_digest/i18n/es_ES.po
  20. 2
      mail_digest/i18n/es_MX.po
  21. 2
      mail_digest/i18n/es_PE.po
  22. 2
      mail_digest/i18n/es_PY.po
  23. 2
      mail_digest/i18n/es_VE.po
  24. 2
      mail_digest/i18n/et.po
  25. 2
      mail_digest/i18n/eu.po
  26. 2
      mail_digest/i18n/fa.po
  27. 2
      mail_digest/i18n/fi.po
  28. 2
      mail_digest/i18n/fr.po
  29. 2
      mail_digest/i18n/fr_CA.po
  30. 2
      mail_digest/i18n/fr_CH.po
  31. 2
      mail_digest/i18n/gl.po
  32. 2
      mail_digest/i18n/gl_ES.po
  33. 2
      mail_digest/i18n/he.po
  34. 2
      mail_digest/i18n/hr.po
  35. 2
      mail_digest/i18n/hr_HR.po
  36. 2
      mail_digest/i18n/hu.po
  37. 2
      mail_digest/i18n/id.po
  38. 2
      mail_digest/i18n/it.po
  39. 2
      mail_digest/i18n/ja.po
  40. 2
      mail_digest/i18n/ko.po
  41. 2
      mail_digest/i18n/lt.po
  42. 2
      mail_digest/i18n/lt_LT.po
  43. 2
      mail_digest/i18n/lv.po
  44. 2
      mail_digest/i18n/mail_digest.pot
  45. 2
      mail_digest/i18n/mk.po
  46. 2
      mail_digest/i18n/mn.po
  47. 2
      mail_digest/i18n/nb.po
  48. 2
      mail_digest/i18n/nb_NO.po
  49. 2
      mail_digest/i18n/nl.po
  50. 2
      mail_digest/i18n/nl_BE.po
  51. 2
      mail_digest/i18n/nl_NL.po
  52. 2
      mail_digest/i18n/pl.po
  53. 2
      mail_digest/i18n/pt.po
  54. 2
      mail_digest/i18n/pt_BR.po
  55. 2
      mail_digest/i18n/pt_PT.po
  56. 2
      mail_digest/i18n/ro.po
  57. 2
      mail_digest/i18n/ru.po
  58. 2
      mail_digest/i18n/sk.po
  59. 2
      mail_digest/i18n/sl.po
  60. 2
      mail_digest/i18n/sr.po
  61. 2
      mail_digest/i18n/sr@latin.po
  62. 2
      mail_digest/i18n/sv.po
  63. 2
      mail_digest/i18n/th.po
  64. 2
      mail_digest/i18n/tr.po
  65. 2
      mail_digest/i18n/tr_TR.po
  66. 2
      mail_digest/i18n/uk.po
  67. 2
      mail_digest/i18n/vi.po
  68. 2
      mail_digest/i18n/vi_VN.po
  69. 2
      mail_digest/i18n/zh_CN.po
  70. 2
      mail_digest/i18n/zh_TW.po
  71. 15
      mail_digest/models/mail_digest.py
  72. 4
      mail_digest/tests/test_digest.py
  73. 2
      mail_digest/views/mail_digest_views.xml

2
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 ""

2
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 ""

2
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 ""

2
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 ""

2
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 ""

2
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 ""

2
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 ""

2
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 ""

2
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 ""

2
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 ""

2
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 ""

2
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 ""

2
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 ""

2
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 ""

2
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 ""

2
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 ""

2
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 ""

2
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 ""

2
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 ""

2
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 ""

2
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 ""

2
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 ""

2
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 ""

2
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 ""

2
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 ""

2
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 ""

2
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 ""

2
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"

2
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 ""

2
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"

2
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 ""

2
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 ""

2
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 ""

2
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 ""

2
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 ""

2
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 ""

2
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 ""

2
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"

2
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 ""

2
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 ""

2
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 ""

2
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 ""

2
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 ""

2
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 ""

2
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 ""

2
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 ""

2
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 ""

2
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 ""

2
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 ""

2
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 ""

2
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 ""

2
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 ""

2
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 ""

2
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 ""

2
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 ""

2
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 ""

2
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 ""

2
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 ""

2
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 ""

2
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 ""

2
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 ""

2
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 ""

2
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 ""

2
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 ""

2
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 ""

2
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 ""

2
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 ""

2
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 ""

2
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 ""

2
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 ""

15
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.'

4
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

2
mail_digest/views/mail_digest_views.xml

@ -33,7 +33,7 @@
<field name="frequency" />
<field name="mail_id" />
<field name="state" />
<field name="template_id" />
<field name="digest_template_id" />
</group>
<group name="messages" string="Messages" col="4">
<field name="message_ids" nolabel="1" />

Loading…
Cancel
Save