Files
suite/hr_timesheet_work_entry/__init__.py
Jared Kipe 7de1e9d6ad [FIX] hr_payroll_timesheet: Fixes for a database that has gone through multiple Odoo Upgrades
Init will run on install, even if the module existed in the prior version.  Because these init scripts are intended to clear (and maybe even re-name back on actual init of data), records we should be more generic with the intended name.

Additionally, if your database already had `hr_payroll_timesheet` based 'TS' work entry codes, then we cannot delete it if it is used on records like payslips (as a work type).  Delete the link to simply stop using the old record, but leave it behind to keep it working.
2021-10-07 16:08:22 +00:00

16 lines
484 B
Python

from . import models
def ts_work_type_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-14' "
"WHERE code = 'TS';"
)