forked from NaN-tic/trytond-electronic_mail_template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtrigger.py
24 lines (20 loc) · 774 Bytes
/
trigger.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# This file is part electronic_mail_template 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 PoolMeta
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 = Transaction().context.get('model', None)
if model:
return model