[NEW] hr_attendance_work_entry: for Odoo 13

This commit is contained in:
Jared Kipe
2020-09-18 11:28:39 -07:00
parent eeb4a40b69
commit 3aa19d714f
3 changed files with 5 additions and 14 deletions

View File

@@ -3,16 +3,12 @@ from . import models
def attn_payroll_pre_init_hook(cr):
"""
This module installs a Work Entry Type with code "ATTN"
This module installs a Work Entry Type with code "ATTN_OT"
If you have undergone a migration (either for this module
or even your own Payslip Work Entry lines with code "ATTN")
or even your own Payslip Work Entry lines with code "ATTN_OT")
then the uniqueness constraint will prevent this module
from installing.
"""
cr.execute("UPDATE hr_work_entry_type "
"SET code = 'ATTN-PRE-INSTALL' "
"WHERE code = 'ATTN';"
)
cr.execute("UPDATE hr_work_entry_type "
"SET code = 'ATTN_OT-PRE-INSTALL' "
"WHERE code = 'ATTN_OT';"

View File

@@ -15,6 +15,7 @@
'depends': [
'hr_payroll',
'hr_attendance',
'hr_attendance_work_entry',
'hr_payroll_overtime',
],
'pre_init_hook': 'attn_payroll_pre_init_hook',

View File

@@ -6,16 +6,10 @@
<field name="name">Attendance Overtime</field>
<field name="code">ATTN_OT</field>
</record>
<record id="work_input_attendance" model="hr.work.entry.type">
<field name="name">Attendance</field>
<field name="code">ATTN</field>
<record id="hr_attendance_work_entry.work_input_attendance" model="hr.work.entry.type">
<field name="overtime_type_id" ref="hr_payroll_overtime.work_entry_overtime_type"/>
<field name="overtime_work_type_id" ref="work_input_attendance_overtime"/>
</record>
<!-- Rename Stock "Attendance" type -->
<record id="hr_work_entry.work_entry_type_attendance" model="hr.work.entry.type">
<field name="name">Work Calendar</field>
</record>
</odoo>