Browse Source

[UPDT] Timer Unit changed to minutes & Version controlling doc added

pull/36/head
SHEREEF PT 8 years ago
parent
commit
7b0ea464bc
  1. 2
      project_task_timer/__manifest__.py
  2. 8
      project_task_timer/doc/changelog.rst
  3. 9
      project_task_timer/models/project_task_timer.py
  4. BIN
      project_task_timer/static/description/timer3.png
  5. 1
      project_task_timer/views/project_task_timer_view.xml

2
project_task_timer/__manifest__.py

@ -22,7 +22,7 @@
##############################################################################
{
'name': 'Project Task Timer',
'version': '10.0.1.0',
'version': '10.0.2.0',
'summary': """Task Timer With Start & Stop""",
'description': """"This module helps you to track time sheet in project automatically.""",
'category': 'Project',

8
project_task_timer/doc/changelog.rst

@ -0,0 +1,8 @@
Changelog
=========
* Jesni Banu contact: jesni@cybrosys.in
`10.0.2.0.0`
------------
- Timer unit changed to minutes (To compact time sheet).

9
project_task_timer/models/project_task_timer.py

@ -29,6 +29,7 @@ class ProjectTaskTimeSheet(models.Model):
date_start = fields.Datetime(string='Start Date')
date_end = fields.Datetime(string='End Date', readonly=1)
timer_duration = fields.Float(invisible=1)
class ProjectTaskTimer(models.Model):
@ -43,11 +44,11 @@ class ProjectTaskTimer(models.Model):
order.is_user_working = False
@api.multi
@api.depends('timesheet_ids.unit_amount')
@api.depends('timesheet_ids.timer_duration')
def _compute_duration(self):
self.duration = 0
for each in self:
each.duration = sum(each.timesheet_ids.mapped('unit_amount'))
each.duration = sum(each.timesheet_ids.mapped('timer_duration'))
@api.multi
def toggle_start(self):
@ -73,9 +74,11 @@ class ProjectTaskTimer(models.Model):
if time_line.date_end:
diff = fields.Datetime.from_string(time_line.date_end) - fields.Datetime.from_string(
time_line.date_start)
time_line.unit_amount = round(diff.total_seconds() / 60.0, 2)
time_line.timer_duration = round(diff.total_seconds() / 60.0, 2)
time_line.unit_amount = round(diff.total_seconds() / (60.0 * 60.0), 2)
else:
time_line.unit_amount = 0.0
time_line.timer_duration = 0.0
task_timer = fields.Boolean()
is_user_working = fields.Boolean(

BIN
project_task_timer/static/description/timer3.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 96 KiB

After

Width:  |  Height:  |  Size: 63 KiB

1
project_task_timer/views/project_task_timer_view.xml

@ -38,6 +38,7 @@
<xpath expr="//field[@name='timesheet_ids']/tree/field[@name='unit_amount']" position="before">
<field name="date_start" required="1"/>
<field name="date_end"/>
<field name="timer_duration" invisible="1"/>
</xpath>
</field>
</record>

Loading…
Cancel
Save