diff options
| author | Okan SUMER (osu) <osu@odoo.com> | 2020-02-05 16:22:00 +0100 |
|---|---|---|
| committer | Yannick Tivisse <yti@odoo.com> | 2020-02-05 16:44:37 +0100 |
| commit | 49f1b59c2835ea1dd807de205df909e4b94b56e4 (patch) | |
| tree | cf9bb9c96fffb52a20232b6c920a0075ae3732fb /addons/test_timer/models | |
| parent | e2b749fb7a441b4337c40cc856459e2e5f95b597 (diff) | |
[ADD] test_timer: Add test module for the timer mixin
Purpose
=======
As testing the mixin requires to create a new model,
we prefered to create another module.
TaskID: 2149450
Diffstat (limited to 'addons/test_timer/models')
| -rw-r--r-- | addons/test_timer/models/__init__.py | 4 | ||||
| -rw-r--r-- | addons/test_timer/models/timer_test.py | 25 |
2 files changed, 29 insertions, 0 deletions
diff --git a/addons/test_timer/models/__init__.py b/addons/test_timer/models/__init__.py new file mode 100644 index 00000000000..e2a77737638 --- /dev/null +++ b/addons/test_timer/models/__init__.py @@ -0,0 +1,4 @@ +# -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. + +from . import timer_test diff --git a/addons/test_timer/models/timer_test.py b/addons/test_timer/models/timer_test.py new file mode 100644 index 00000000000..5eb26b7618d --- /dev/null +++ b/addons/test_timer/models/timer_test.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. + +from odoo import fields, models + + +class TimerTest(models.Model): + """ A very simple model only inheriting from timer.mixin to test + timer features """ + _description = 'Timer Model' + _name = 'timer.test' + _inherit = ['timer.mixin'] + + name = fields.Char(required=1) + + +class OverrideInterruptionTimerTest(models.Model): + """ A very simple model inheriting from timer.mixin and + overriding _action_interrupt_user_timers() """ + _description = 'Interruption Timer Model' + _name = 'interruption.timer.test' + _inherit = ['timer.mixin'] + + def _action_interrupt_user_timers(self): + self.action_timer_stop() |
