[IMP] hr_payroll_timesheet: require hr_timesheet_work_type and use the timesheet's specififed work entry type

This commit is contained in:
Jared Kipe
2020-10-06 12:14:49 -07:00
parent fd32e01a0e
commit 6ec7c3f24c
6 changed files with 87 additions and 17 deletions

View File

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