Merge branch 'mig/13.0/hr_payroll_attendance' into '13.0-test'

mig/13.0/hr_payroll_attendance into 13.0-test

See merge request hibou-io/hibou-odoo/suite!450
This commit is contained in:
Hibou Bot
2020-09-03 19:53:52 +00:00
3 changed files with 25 additions and 0 deletions

View File

@@ -1 +1,19 @@
from . import models
def attn_payroll_pre_init_hook(cr):
"""
This module installs a Work Entry Type with code "ATTN"
If you have undergone a migration (either for this module
or even your own Payslip Work Entry lines with code "ATTN")
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

@@ -17,4 +17,5 @@
'hr_attendance',
'hr_payroll_overtime',
],
'pre_init_hook': 'attn_payroll_pre_init_hook',
}

View File

@@ -0,0 +1,6 @@
def migrate(cr, version):
# pre_init_hook script only runs on install,
# if you're coming from 12.0 we need the same change
from odoo.addons.hr_payroll_timesheet import attn_payroll_pre_init_hook
attn_payroll_pre_init_hook(cr)