2014-12-02 12:54:01 +01:00
|
|
|
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
|
|
|
|
# this repository contains the full copyright notices and license terms.
|
2010-05-29 15:58:49 +02:00
|
|
|
from trytond.model import ModelSQL, fields
|
|
|
|
|
|
2012-09-24 22:16:53 +02:00
|
|
|
__all__ = [
|
2013-03-06 17:00:34 +01:00
|
|
|
'Triggered', 'TriggerAction',
|
2012-09-24 22:16:53 +02:00
|
|
|
]
|
|
|
|
|
|
2010-05-29 15:58:49 +02:00
|
|
|
TRIGGER_LOGS = []
|
|
|
|
|
|
2012-04-01 23:08:15 +02:00
|
|
|
|
2010-05-29 15:58:49 +02:00
|
|
|
class Triggered(ModelSQL):
|
|
|
|
|
'Triggered'
|
2012-09-24 22:16:53 +02:00
|
|
|
__name__ = 'test.triggered'
|
2010-05-29 15:58:49 +02:00
|
|
|
name = fields.Char('Name')
|
|
|
|
|
|
2013-03-06 17:00:34 +01:00
|
|
|
|
|
|
|
|
class TriggerAction(ModelSQL):
|
|
|
|
|
'Trigger Action Model'
|
|
|
|
|
__name__ = 'test.trigger_action'
|
|
|
|
|
|
2012-09-24 22:16:53 +02:00
|
|
|
@staticmethod
|
|
|
|
|
def trigger(records, trigger):
|
2010-05-29 15:58:49 +02:00
|
|
|
'''
|
|
|
|
|
Trigger function for test
|
|
|
|
|
'''
|
2012-09-24 22:16:53 +02:00
|
|
|
TRIGGER_LOGS.append((records, trigger))
|