[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
This commit is contained in:
Okan SUMER (osu)
2020-02-05 16:44:37 +01:00
committed by Yannick Tivisse
parent e2b749fb7a
commit 49f1b59c28
7 changed files with 201 additions and 0 deletions
+25
View File
@@ -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()