[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.
This commit is contained in:
Jared Kipe
2021-03-21 13:35:09 -07:00
parent a4478c18f7
commit 613b2dd3ea

View File

@@ -10,6 +10,6 @@ def attn_payroll_pre_init_hook(cr):
from installing.
"""
cr.execute("UPDATE hr_work_entry_type "
"SET code = 'ATTN_OT-PRE-INSTALL' "
"SET code = 'ATTN_OT-PRE-INSTALL-14' "
"WHERE code = 'ATTN_OT';"
)