Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---Models in module 'sale_timesheet'---
obsolete model project.task.assign.sale [transient]
# NOTHING TO DO

---Fields in module 'sale_timesheet'---
sale_timesheet / account.analytic.line / timesheet_invoice_id (many2one): relation is now 'account.move' ('account.invoice') [nothing to do]
sale_timesheet / account.invoice / timesheet_ids (one2many) : DEL relation: account.analytic.line
sale_timesheet / account.move / timesheet_ids (one2many) : NEW relation: account.analytic.line
# DONE: pre-migration: renamed column for avoiding FK constraint
# DONE: post-migration: mapped invoice to moves

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']')
# DONE: pre-migration: copied column for preserving old values
# DONE: post-migration: change 'task_new_project' by 'task_in_project'

sale_timesheet / sale.order / project_id (many2one) : NEW relation: project.project
# NOTHING TO DO: new feature for improving 'task_in_project' to handle more use cases

---XML records in module 'sale_timesheet'---
NEW ir.actions.act_window: sale_timesheet.product_template_action_default_services
NEW ir.actions.act_window: sale_timesheet.project_timesheet_action_client_timesheet_plan
NEW ir.actions.act_window: sale_timesheet.timesheet_action_from_sales_order
DEL ir.actions.act_window: sale_timesheet.product_template_action_fixed
DEL ir.actions.act_window: sale_timesheet.product_template_action_milestone
DEL ir.actions.act_window: sale_timesheet.product_template_action_time_based
DEL ir.actions.act_window: sale_timesheet.project_task_action_multi_assign_so_line
NEW ir.actions.act_window.view: sale_timesheet.timesheet_action_from_sales_order_form
NEW ir.actions.act_window.view: sale_timesheet.timesheet_action_from_sales_order_tree
DEL ir.actions.client: sale_timesheet.project_timesheet_action_client_timesheet_plan
NEW ir.ui.view: sale_timesheet.assets_frontend
NEW ir.ui.view: sale_timesheet.portal_invoice_page_inherit_timesheet
NEW ir.ui.view: sale_timesheet.progressbar
DEL ir.ui.view: sale_timesheet.project_project_view_search
DEL ir.ui.view: sale_timesheet.project_task_assign_so_line_view_form
DEL ir.ui.view: sale_timesheet.qunit_suite
# NOTHING TO DO
31 changes: 31 additions & 0 deletions addons/sale_timesheet/migrations/13.0.1.0/post-migration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Copyright 2020 ForgeFlow S.L. (https://www.forgeflow.com)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openupgradelib import openupgrade


def map_invoices_to_moves(env):
openupgrade.logged_query(
env.cr, """
UPDATE account_analytic_line aal
SET timesheet_invoice_id = am.id
FROM account_move am
WHERE aal.{} = am.old_invoice_id
""".format(openupgrade.get_legacy_name('timesheet_invoice_id')),
)


def map_mail_notification_type(env):
openupgrade.map_values(
env.cr,
openupgrade.get_legacy_name('service_tracking'),
'service_tracking',
[('task_new_project', 'task_in_project'),
],
table='product_template',
)


@openupgrade.migrate()
def migrate(env, version):
map_invoices_to_moves(env)
map_mail_notification_type(env)
22 changes: 22 additions & 0 deletions addons/sale_timesheet/migrations/13.0.1.0/pre-migration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright 2020 ForgeFlow S.L. (https://www.forgeflow.com)
# Copyright 2020 Tecnativa - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openupgradelib import openupgrade

_column_copies = {
'product_template': [
('service_tracking', None, None),
],
}
_column_renames = {
'account_analytic_line': [
('timesheet_invoice_id', None),
],
}


@openupgrade.migrate()
def migrate(env, version):
cr = env.cr
openupgrade.copy_columns(cr, _column_copies)
openupgrade.rename_columns(cr, _column_renames)
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 @@ -581,7 +581,7 @@ missing in the new release are marked with |del|.
+----------------------------------------------+-------------------------------------------------+
|sale_stock | |
+----------------------------------------------+-------------------------------------------------+
|sale_timesheet | |
|sale_timesheet | Done |
+----------------------------------------------+-------------------------------------------------+
| |new| sale_timesheet_purchase | |
+----------------------------------------------+-------------------------------------------------+
Expand Down