Simplify trigger action

issue9096
This commit is contained in:
Raimon Esteve 2020-05-06 16:29:00 +02:00
parent 3750bdc113
commit d7310990a6
4 changed files with 16 additions and 3 deletions

View File

@ -302,6 +302,10 @@ msgctxt "selection:electronic.mail.template,engine:"
msgid "Python"
msgstr "Python"
msgctxt "selection:ir.trigger,action:"
msgid "Email Template"
msgstr "Plantilla correu"
msgctxt "view:electronic.mail.send.template.start:"
msgid "Body HTML"
msgstr "HTML body"

View File

@ -307,6 +307,10 @@ msgctxt "selection:electronic.mail.template,engine:"
msgid "Python"
msgstr "Python"
msgctxt "selection:ir.trigger,action:"
msgid "Email Template"
msgstr "Plantilla correu"
msgctxt "view:electronic.mail.send.template.start:"
msgid "Body HTML"
msgstr "Texto HTML"

View File

@ -12,10 +12,15 @@ class Trigger(metaclass=PoolMeta):
__name__ = 'ir.trigger'
email_template = fields.Many2One('electronic.mail.template', 'Template')
@classmethod
def __setup__(cls):
super().__setup__()
cls.action.selection.append(
('electronic.mail.template|mail_from_trigger', "Email Template"),
)
@staticmethod
def default_model():
Model = Pool().get('ir.model')
model = Transaction().context.get('model', None)
if model:
return model

View File

@ -2,7 +2,7 @@
<!-- This file is part electronic_mail module for Tryton.
The COPYRIGHT file at the top level of this repository contains the full copyright notices and license terms. -->
<data>
<xpath expr="/form/field[@name='action_function']" position="after">
<xpath expr="/form/field[@name='action']" position="after">
<label name="email_template"/>
<field name="email_template" readonly="1"/>
</xpath>