mirror of
https://gitlab.com/hibou-io/hibou-odoo/suite.git
synced 2025-01-20 12:37:31 +02:00
[IMP] hr_payroll_timesheet: Migration script for 13
This commit is contained in:
@@ -1 +1,19 @@
|
||||
from . import models
|
||||
|
||||
|
||||
def ts_payroll_pre_init_hook(cr):
|
||||
"""
|
||||
This module installs a Work Entry Type with code "TS"
|
||||
If you have undergone a migration (either for this module
|
||||
or even your own Payslip Work Entry lines with code "TS")
|
||||
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';"
|
||||
)
|
||||
|
||||
@@ -16,4 +16,5 @@
|
||||
'hr_timesheet',
|
||||
'hr_payroll_overtime',
|
||||
],
|
||||
'pre_init_hook': 'ts_payroll_pre_init_hook',
|
||||
}
|
||||
|
||||
@@ -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 ts_payroll_pre_init_hook
|
||||
ts_payroll_pre_init_hook(cr)
|
||||
Reference in New Issue
Block a user