Skip to content

Commit 3db456c

Browse files
[MIG] sale_timesheet
1 parent ace5606 commit 3db456c

File tree

4 files changed

+84
-1
lines changed

4 files changed

+84
-1
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---Models in module 'sale_timesheet'---
2+
obsolete model project.task.assign.sale [transient]
3+
# NOTHING TO DO
4+
5+
---Fields in module 'sale_timesheet'---
6+
sale_timesheet / account.analytic.line / timesheet_invoice_id (many2one): relation is now 'account.move' ('account.invoice') [nothing to do]
7+
sale_timesheet / account.invoice / timesheet_ids (one2many) : DEL relation: account.analytic.line
8+
sale_timesheet / account.move / timesheet_ids (one2many) : NEW relation: account.analytic.line
9+
# DONE: post-migration: mapped invoice to moves
10+
11+
sale_timesheet / product.template / service_tracking (selection) : selection_keys is now '['no', 'project_only', 'task_global_project', 'task_in_project']' ('['no', 'project_only', 'task_global_project', 'task_new_project']')
12+
# DONE: post-migration: change 'task_new_project' by 'task_in_project'
13+
14+
sale_timesheet / sale.order / project_id (many2one) : NEW relation: project.project
15+
# NOTHING TO DO: new feature for improving 'task_in_project' to handle more use cases
16+
17+
---XML records in module 'sale_timesheet'---
18+
NEW ir.actions.act_window: sale_timesheet.product_template_action_default_services
19+
NEW ir.actions.act_window: sale_timesheet.project_timesheet_action_client_timesheet_plan
20+
NEW ir.actions.act_window: sale_timesheet.timesheet_action_from_sales_order
21+
DEL ir.actions.act_window: sale_timesheet.product_template_action_fixed
22+
DEL ir.actions.act_window: sale_timesheet.product_template_action_milestone
23+
DEL ir.actions.act_window: sale_timesheet.product_template_action_time_based
24+
DEL ir.actions.act_window: sale_timesheet.project_task_action_multi_assign_so_line
25+
NEW ir.actions.act_window.view: sale_timesheet.timesheet_action_from_sales_order_form
26+
NEW ir.actions.act_window.view: sale_timesheet.timesheet_action_from_sales_order_tree
27+
DEL ir.actions.client: sale_timesheet.project_timesheet_action_client_timesheet_plan
28+
NEW ir.ui.view: sale_timesheet.assets_frontend
29+
NEW ir.ui.view: sale_timesheet.portal_invoice_page_inherit_timesheet
30+
NEW ir.ui.view: sale_timesheet.progressbar
31+
DEL ir.ui.view: sale_timesheet.project_project_view_search
32+
DEL ir.ui.view: sale_timesheet.project_task_assign_so_line_view_form
33+
DEL ir.ui.view: sale_timesheet.qunit_suite
34+
# NOTHING TO DO
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Copyright 2020 ForgeFlow S.L. (https://www.forgeflow.com)
2+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
3+
from openupgradelib import openupgrade
4+
5+
6+
def map_invoices_to_moves(env):
7+
openupgrade.logged_query(
8+
env.cr, """
9+
UPDATE account_analytic_line aal
10+
SET timesheet_invoice_id = am.id
11+
FROM account_move am
12+
WHERE aal.{} = am.old_invoice_id
13+
""".format(openupgrade.get_legacy_name('timesheet_invoice_id')),
14+
)
15+
16+
17+
def map_mail_notification_type(env):
18+
openupgrade.map_values(
19+
env.cr,
20+
openupgrade.get_legacy_name('service_tracking'),
21+
'service_tracking',
22+
[('task_new_project', 'task_in_project'),
23+
],
24+
table='product_template',
25+
)
26+
27+
28+
@openupgrade.migrate()
29+
def migrate(env, version):
30+
map_invoices_to_moves(env)
31+
map_mail_notification_type(env)
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Copyright 2020 ForgeFlow S.L. (https://www.forgeflow.com)
2+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
3+
from openupgradelib import openupgrade
4+
5+
_column_renames = {
6+
'product_template': [
7+
('service_tracking', None),
8+
],
9+
'account_analytic_line': [
10+
('timesheet_invoice_id', None),
11+
],
12+
}
13+
14+
15+
@openupgrade.migrate()
16+
def migrate(env, version):
17+
cr = env.cr
18+
openupgrade.rename_columns(cr, _column_renames)

odoo/openupgrade/doc/source/modules120-130.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ missing in the new release are marked with |del|.
581581
+----------------------------------------------+-------------------------------------------------+
582582
|sale_stock | |
583583
+----------------------------------------------+-------------------------------------------------+
584-
|sale_timesheet | |
584+
|sale_timesheet | Done |
585585
+----------------------------------------------+-------------------------------------------------+
586586
| |new| sale_timesheet_purchase | |
587587
+----------------------------------------------+-------------------------------------------------+

0 commit comments

Comments
 (0)