2017-03-16 18:48:43 +01:00
|
|
|
# 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.
|
|
|
|
from trytond.model import fields
|
|
|
|
from trytond.transaction import Transaction
|
|
|
|
from trytond.pool import Pool, PoolMeta
|
|
|
|
|
|
|
|
__all__ = ['Trigger']
|
|
|
|
|
|
|
|
|
2018-09-15 18:09:14 +02:00
|
|
|
class Trigger(metaclass=PoolMeta):
|
2017-03-16 18:48:43 +01:00
|
|
|
__name__ = 'ir.trigger'
|
|
|
|
email_template = fields.Many2One('electronic.mail.template', 'Template')
|
|
|
|
|
2020-05-06 16:29:00 +02:00
|
|
|
@classmethod
|
|
|
|
def __setup__(cls):
|
|
|
|
super().__setup__()
|
|
|
|
cls.action.selection.append(
|
|
|
|
('electronic.mail.template|mail_from_trigger', "Email Template"),
|
|
|
|
)
|
|
|
|
|
2017-03-16 18:48:43 +01:00
|
|
|
@staticmethod
|
|
|
|
def default_model():
|
|
|
|
model = Transaction().context.get('model', None)
|
|
|
|
if model:
|
|
|
|
return model
|