mirror of
https://gitlab.com/hibou-io/hibou-odoo/suite.git
synced 2025-01-20 12:37:31 +02:00
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.
20 lines
591 B
Python
20 lines
591 B
Python
# Part of Hibou Suite Professional. See LICENSE_PROFESSIONAL file for full copyright and licensing details.
|
|
|
|
import odoo
|
|
|
|
|
|
def migrate(cr, version):
|
|
"""
|
|
In 13.0, we had our own work type:
|
|
hr_payroll_timesheet.work_input_timesheet
|
|
|
|
This was moved to `hr_timesheet_work_entry`
|
|
We will unlink the XML ref so that the record will be kept.
|
|
"""
|
|
env = odoo.api.Environment(cr, odoo.SUPERUSER_ID, {})
|
|
xml_refs = env['ir.model.data'].search([
|
|
('module', '=', 'hr_payroll_timesheet'),
|
|
('name', '=', 'work_input_timesheet'),
|
|
])
|
|
xml_refs.unlink()
|