Commits

Raimon Esteve (Zikzakmedia)  committed 8240f01

Check if template available a wizard

  • Participants
  • Parent commits 321afd7

Comments (0)

Files changed (3)

File electronic_mail_wizard.py

             ])
     send = StateTransition()
 
+    def __init__(self):
+        super(GenerateTemplateEmail, self).__init__()
+        self._error_messages.update({
+            'template_missing': 'You can select a template in this wizard.',
+            })
+
     def render(self, template, record, values):
         '''Renders the template and returns as email object
         :param template: Browse Record of the template
         if not len(wizards) > 0:
             return default
         wizard = wizard_obj.browse(wizards[0])
+        if not wizard.template:
+            self.raise_user_error('template_missing')
         template = wizard.template[0]
         total = len(active_ids)
 

File locale/ca_ES.po

 msgid ""
 msgstr "Content-Type: text/plain; charset=utf-8\n"
 
+msgctxt "error:electronic_mail_wizard.example:"
+msgid "You can select a template in this wizard."
+msgstr "Selecciona una plantilla per aquesta acció."
+
+msgctxt "error:electronic_mail_wizard.templateemail:"
+msgid "You can select a template in this wizard."
+msgstr "Selecciona una plantilla per aquesta acció."
+
 msgctxt "field:electronic.mail.template,wizard:"
 msgid "Wizard"
 msgstr "Assistent"
 msgid "Send Email"
 msgstr "Envia correu"
 
+msgctxt "wizard_button:electronic_mail_wizard.example,start,end:"
+msgid "Cancel"
+msgstr "Cancel·lar"
+
+msgctxt "wizard_button:electronic_mail_wizard.example,start,send:"
+msgid "Send"
+msgstr "Enviar"
+
 msgctxt "wizard_button:electronic_mail_wizard.templateemail,start,end:"
 msgid "Cancel"
 msgstr "Cancel·lar"

File locale/es_ES.po

 msgid ""
 msgstr "Content-Type: text/plain; charset=utf-8\n"
 
+msgctxt "error:electronic_mail_wizard.example:"
+msgid "You can select a template in this wizard."
+msgstr "Seleccione una plantilla para esta acción."
+
+msgctxt "error:electronic_mail_wizard.templateemail:"
+msgid "You can select a template in this wizard."
+msgstr "Seleccione una plantilla para esta acción."
+
 msgctxt "field:electronic.mail.template,wizard:"
 msgid "Wizard"
 msgstr "Asistente"