Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0][OU-ADD] sale_project: migration #4047

Closed
Closed
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
2 changes: 1 addition & 1 deletion docsource/modules150-160.rst
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,7 @@ Module coverage 15.0 -> 16.0
+-------------------------------------------------+----------------------+-------------------------------------------------+
| sale_product_matrix | |No DB layout changes. |
+-------------------------------------------------+----------------------+-------------------------------------------------+
| sale_project | | |
| sale_project | Done | |
+-------------------------------------------------+----------------------+-------------------------------------------------+
| |del| sale_project_account | | |
+-------------------------------------------------+----------------------+-------------------------------------------------+
Expand Down
24 changes: 24 additions & 0 deletions openupgrade_scripts/scripts/sale_project/16.0.1.0/pre-migration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
from openupgradelib import openupgrade


def _move_fields(env):
openupgrade.update_module_moved_fields(
env.cr, "product.product", ["service_policy"], "sale_timesheet", "sale"
)
openupgrade.update_module_moved_fields(
env.cr, "product.template", ["service_policy"], "sale_timesheet", "sale"
)
openupgrade.update_module_moved_fields(
env.cr, "project.project", ["allow_billable"], "sale_timesheet", "sale"
)
openupgrade.update_module_moved_fields(
env.cr, "project.project", ["invoice_count"], "account_sale_timesheet", "sale"
)
openupgrade.update_module_moved_fields(
env.cr, "project.project", ["vendor_bill_count"], "sale_project_account", "sale"
)


@openupgrade.migrate()
def migrate(env, version):
_move_fields(env)
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---Models in module 'sale_project'---
---Fields in module 'sale_project'---
sale_project / product.product / service_policy (selection) : previously in module sale_timesheet
sale_project / product.template / service_policy (selection) : previously in module sale_timesheet
# DONE: pre-migration: moved fields

sale_project / product.template / service_type (False) : NEW selection_keys: ['manual', 'milestones'], mode: modify
sale_project / project.milestone / quantity_percentage (float) : NEW
sale_project / project.milestone / sale_line_id (many2one) : NEW relation: sale.order.line
# NOTHING TO DO

sale_project / project.project / allow_billable (boolean) : previously in module sale_timesheet
sale_project / project.project / invoice_count (integer) : previously in module account_sale_timesheet
sale_project / project.project / vendor_bill_count (integer) : previously in module sale_project_account
# DONE: pre-migration: moved fields

sale_project / sale.order.line / qty_delivered_method (False) : NEW selection_keys: ['analytic', 'manual', 'milestones', 'stock_move'], mode: modify
sale_project / sale.order.line / reached_milestones_ids (one2many): NEW relation: project.milestone
# NOTHING TO DO

---XML records in module 'sale_project'---
NEW ir.ui.view: sale_project.project_milestone_view_form
NEW ir.ui.view: sale_project.project_milestone_view_tree
NEW ir.ui.view: sale_project.sale_project_milestone_view_tree
DEL ir.ui.view: sale_project.project_task_view_form_inherit_sale_line_editable
# NOTHING TO DO: noupdate="0" records