-
- Downloads
[IMP] hr_timesheet: add timer into list and kanban views for timesheets
TaskID: 2088586 Timer in the list and kanban views : ---------------------------------- In kanban and list views, It's possible to update the 'unit_amount' field with a timer. The user can easily launch the timer in these views for one of his timesheets. One timesheet can be launched at the same time, when the user start a timer for a timesheet and start another timer for another timesheet, the first timer stop and the new timer start. The timer is usable only if the encoding unit is 'Hours' and the timesheet is not validated. To do this : a new computed field 'display_timer' is created in account.analytic.line, this field is set to True is the encoding unit is 'Hours'. With this field, we can easily hide and display the timer in different views. The user can only use the timer for his timesheets. Because the user with the access rights to see all timesheets might launch and/or stop a timer of a timesheet of other user. That is the timer must be accessed only in 'My Timesheets' menu. Add pivot view for 'All timesheets' menu. Creation a timer_mixin : ---------------------- With this timer mixin, we can have a generic timer to use in other models that they need to use a timer like account.analytic.line and project.task models The timer in account.analytic.line model has changed to use the timer mixin. Specific behaviour of the timer : ------------------------------- When the user use the timer and the minutes spent with the timer is less than 1 minute, we don't add in unit_amount of timesheet. If the unit_amount is equals to 0 and minutes spent of timer is less than 0. Then the timesheet created by the timer is deleted because it is useless to have a timesheet with unit_amount set on 0. Misc : ---- Add some styles for the timer button and for the 'unit_amount' field when the timer is running. remove duplicated fields in tree view (record id='timesheet_view_tree_user')
Showing
- addons/hr_timesheet/models/__init__.py 1 addition, 0 deletionsaddons/hr_timesheet/models/__init__.py
- addons/hr_timesheet/models/hr_timesheet.py 69 additions, 5 deletionsaddons/hr_timesheet/models/hr_timesheet.py
- addons/hr_timesheet/models/timer_mixin.py 67 additions, 0 deletionsaddons/hr_timesheet/models/timer_mixin.py
- addons/hr_timesheet/security/hr_timesheet_security.xml 27 additions, 33 deletionsaddons/hr_timesheet/security/hr_timesheet_security.xml
- addons/hr_timesheet/security/ir.model.access.csv 1 addition, 3 deletionsaddons/hr_timesheet/security/ir.model.access.csv
- addons/hr_timesheet/static/src/js/Timer.js 92 additions, 0 deletionsaddons/hr_timesheet/static/src/js/Timer.js
- addons/hr_timesheet/static/src/js/timer_toggle_button.js 77 additions, 0 deletionsaddons/hr_timesheet/static/src/js/timer_toggle_button.js
- addons/hr_timesheet/static/src/js/timesheet_kanban_view.js 34 additions, 0 deletionsaddons/hr_timesheet/static/src/js/timesheet_kanban_view.js
- addons/hr_timesheet/static/src/js/timesheet_list_view.js 34 additions, 0 deletionsaddons/hr_timesheet/static/src/js/timesheet_list_view.js
- addons/hr_timesheet/static/src/js/timesheet_uom.js 94 additions, 20 deletionsaddons/hr_timesheet/static/src/js/timesheet_uom.js
- addons/hr_timesheet/static/src/scss/timer_button.scss 26 additions, 0 deletionsaddons/hr_timesheet/static/src/scss/timer_button.scss
- addons/hr_timesheet/views/assets.xml 6 additions, 1 deletionaddons/hr_timesheet/views/assets.xml
- addons/hr_timesheet/views/hr_timesheet_views.xml 20 additions, 5 deletionsaddons/hr_timesheet/views/hr_timesheet_views.xml
Loading
Please register or sign in to comment