From e2b749fb7a441b4337c40cc856459e2e5f95b597 Mon Sep 17 00:00:00 2001 From: "Okan SUMER (osu)" Date: Wed, 5 Feb 2020 16:15:29 +0100 Subject: [ADD] timer: New mixin to record time on models Purpose ======= The timer mechanism is already existing on timesheet. We would like to introduce it on helpdesk.ticket too, and probably on other models afterward. On the other hand, only one timer can be launched on a single timesheet currently, shared amongst the different users. This commit introduced a new mixin on which - Each user can launch a timer on each record of the models inheriting the mixin. - Launching a new timer on a record pauses the timer of the user that could be already running. - The mixin brings methods to start/stop/pause/resume the timer, that could be overridden to implement a specific behavior for the related model, for example create a timesheet entry. TaskID: 2149450 --- addons/timer/security/timer_security.xml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 addons/timer/security/timer_security.xml (limited to 'addons/timer/security/timer_security.xml') diff --git a/addons/timer/security/timer_security.xml b/addons/timer/security/timer_security.xml new file mode 100644 index 00000000000..662a2aac0d7 --- /dev/null +++ b/addons/timer/security/timer_security.xml @@ -0,0 +1,32 @@ + + + + + + timer.user.rule.create-write-delete + + [ + ('user_id', '=', user.id) + ] + + + + + + + + + timer.not.user.rule.create-write-delete + + [ + ('user_id', '!=', user.id) + ] + + + + + + + + + -- cgit v1.2.3