Skip to content

Commit

Permalink
[MIG] hr_timesheet
Browse files Browse the repository at this point in the history
  • Loading branch information
Yasaie authored and pedrobaeza committed Nov 26, 2020
1 parent 8b8c21a commit 4e5c97c
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---Models in module 'hr_timesheet'---
---Fields in module 'hr_timesheet'---
hr_timesheet / account.analytic.account / project_count (integer) : module is now 'project' ('hr_timesheet')
hr_timesheet / account.analytic.account / project_ids (one2many) : module is now 'project' ('hr_timesheet')
hr_timesheet / project.project / analytic_account_id (many2one): module is now 'project' ('hr_timesheet')
# NOTHING TO DO: Done on `project` module

---XML records in module 'hr_timesheet'---
DEL ir.actions.act_window: hr_timesheet.project_task_action_view_timesheet
NEW ir.actions.act_window.view: hr_timesheet.timesheet_action_view_report_by_employee_graph
NEW ir.actions.act_window.view: hr_timesheet.timesheet_action_view_report_by_project_graph
NEW ir.actions.act_window.view: hr_timesheet.timesheet_action_view_report_by_task_graph
DEL ir.model.access: hr_timesheet.access_account_analytic_account_portal
DEL ir.model.access: hr_timesheet.access_account_analytic_line_portal
NEW ir.ui.view: hr_timesheet.portal_layout
NEW ir.ui.view: hr_timesheet.portal_my_home_timesheet
NEW ir.ui.view: hr_timesheet.portal_my_timesheets
NEW ir.ui.view: hr_timesheet.portal_timesheet_table
NEW ir.ui.view: hr_timesheet.view_hr_timesheet_line_graph
DEL ir.ui.view: hr_timesheet.account_analytic_account_view_form_inherit
NEW res.groups: hr_timesheet.group_hr_timesheet_approver
# NOTHING TO DO: noupdate=0

NEW ir.module.category: base.module_category_operations_timesheets (noupdate)
# NOTHING TO DO: New record

DEL ir.model.access: hr_timesheet.access_account_analytic_account_manager [renamed to project module]
DEL ir.model.access: hr_timesheet.access_account_analytic_account_user [renamed to project module]
DEL ir.model.access: hr_timesheet.access_account_analytic_line_project [renamed to project module]
# NOTHING TO DO: Done in `project` module

DEL ir.rule: hr_timesheet.timesheet_rule_portal (noupdate)
# DONE: post-migration removed

res.groups: hr_timesheet.group_timesheet_manager (noupdate switched)
# DONE: pre-migration noupdate disabled
13 changes: 13 additions & 0 deletions addons/hr_timesheet/migrations/13.0.1.0/post-migration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright 2020 Payam Yasaie <https://www.tashilgostar.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openupgradelib import openupgrade

_unlink_by_xmlid = [
'hr_timesheet.timesheet_rule_portal',
]


@openupgrade.migrate()
def migrate(env, version):
openupgrade.delete_records_safely_by_xml_id(env, _unlink_by_xmlid)
openupgrade.load_data(env.cr, 'hr_timesheet', 'migrations/13.0.1.0/noupdate_changes.xml')
15 changes: 15 additions & 0 deletions addons/hr_timesheet/migrations/13.0.1.0/pre-migration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright 2020 Payam Yasaie <https://www.tashilgostar.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openupgradelib import openupgrade


@openupgrade.migrate()
def migrate(env, version):
openupgrade.set_xml_ids_noupdate_value(
env,
"hr_timesheet",
[
"group_timesheet_manager",
],
False,
)
2 changes: 1 addition & 1 deletion odoo/openupgrade/doc/source/modules120-130.rst
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ missing in the new release are marked with |del|.
+----------------------------------------------+-------------------------------------------------+
| |new| hr_skills_survey | |
+----------------------------------------------+-------------------------------------------------+
|hr_timesheet | |
|hr_timesheet | Done |
+----------------------------------------------+-------------------------------------------------+
|hr_timesheet_attendance | |
+----------------------------------------------+-------------------------------------------------+
Expand Down

0 comments on commit 4e5c97c

Please sign in to comment.