Compare commits

...

5 Commits

3 changed files with 30 additions and 10 deletions

View File

@ -212,21 +212,39 @@ class HRTimesheetSheet(models.Model):
active_outgoing_mail_server = ir_mail_env.search([('id','!=',False)], limit=1)
email_vals = { }
# Yes, it's real. Given names are stored in a field called "surname".
body_html= """
<p>
Hallo """+str(employee_brw.name) +""",
Hallo """+str(employee_brw.surname) +""",
</p>
<p>
Sie wurden automatisch von TicTac abgemeldet. Bitte passen Sie ihr Timesheet an.
dein Timetracking wurde automatisch beendet. Bitte editiere dein Timesheet, damit
deine Arbeitszeit richtig hinterlegt ist.
</p>
<p>
Vielen Dank ihr HR Team.
Vielen Dank<br>
Dein Team Personal
</p>
<p>
-----------
</p>
<p>
Dear """+str(employee_brw.surname) +""",
</p>
<p>
Your time tracking was automatically stopped. Please edit your timesheet so
that your working hours are stored correctly.
</p>
<p>
Many Thanks<br>
Your HR team
</p>
"""
email_vals['email_from'] = employee_brw.company_id and employee_brw.company_id.email or 'info@yourcompany.example.com'
email_vals['email_to'] = email_to
email_vals['subject'] = 'Automatic Sign Out'
email_vals['subject'] = 'TicTac - Automatic Sign Out'
email_vals['body_html'] = body_html
# if active_outgoing_mail_server:
# email_vals['mail_server_id'] = active_outgoing_mail_server.id

View File

@ -39,7 +39,9 @@
<field name="model">hr.leave.journal</field>
<!--<field name="view_type">tree</field>-->
<field name="arch" type="xml">
<tree>
<tree>
<field name="write_date"/>
<field name="write_uid"/>
<field name="name"/>
<field name="employee_id"/>
<field name="year"/>

View File

@ -166,7 +166,7 @@ class HRHoliday(models.Model):
'user_id': self.employee_id.user_id.id,
'sheet_id': sheet.id,
})
return timesheet_obj.create(cr, SUPERUSER_ID, res)
return timesheet_obj.create(cr, SUPERUSER_ID, res, context=res)
@api.multi
def count_day_hours_leave(self):
@ -291,10 +291,10 @@ class HRHoliday(models.Model):
if cont_start_date <= temp_date:
if self.get_hours(weekday, contract.working_hours.attendance_ids) > 0.0:
if temp_date == date_from and self.leave_selection =='half_day':
res += 0.25
res += 0.5
break
if temp_date == date_to and self.leave_selection_date_to =='half_day':
res += 0.25
res += 0.5
break
res += 1
else:
@ -303,10 +303,10 @@ class HRHoliday(models.Model):
if cont_start_date <= temp_date and cont_end_date >= temp_date:
if self.get_hours(weekday, contract.working_hours.attendance_ids) > 0.0:
if temp_date == date_from and self.leave_selection =='half_day':
res += 0.25
res += 0.5
break
if temp_date == date_to and self.leave_selection_date_to =='half_day':
res += 0.25
res += 0.5
break
res += 1
temp_date += timedelta(days=1)