Browse Source

[FIX] Bug Fixed 'project_task_timer'

pull/129/head
Ajmalcybrosys 6 years ago
parent
commit
06d6a26fe5
  1. 10
      project_task_timer/models/project_task_timer.py
  2. 16
      project_task_timer/views/project_task_timer_view.xml

10
project_task_timer/models/project_task_timer.py

@ -51,6 +51,16 @@ class ProjectTaskTimer(models.Model):
else:
order.is_user_working = False
def _compute_duration(self):
self
def set_date_end(self):
if self.timesheet_ids:
for data in self.timesheet_ids:
if not data.date_end:
end_date = datetime.combine(data.date, datetime.min.time())
data.date_end = end_date
@api.multi
def toggle_start(self):
for record in self:

16
project_task_timer/views/project_task_timer_view.xml

@ -6,6 +6,9 @@
<field name="model">project.task</field>
<field name="inherit_id" ref="project.view_task_form2"/>
<field name="arch" type="xml">
<xpath expr="//header" position="inside">
<button name="set_date_end" string="Set Date End" type="object"/>
</xpath>
<xpath expr="//div[@name='button_box']" position="inside">
<button name="toggle_start" type="object"
class="oe_stat_button" icon="fa-clock-o">
@ -41,5 +44,18 @@
</xpath>
</field>
</record>
<record id="inherit_analytic_line_timer" model="ir.ui.view">
<field name="name">account.analytic.line.timer.inherit</field>
<field name="model">account.analytic.line</field>
<field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_tree"/>
<field name="arch" type="xml">
<data>
<xpath expr="//field[@name='task_id']" position="after">
<field name="date_start"/>
<field name="date_end"/>
</xpath>
</data>
</field>
</record>
</data>
</odoo>
Loading…
Cancel
Save