Skip to content
Open
Show file tree
Hide file tree
Changes from 3 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
4 changes: 2 additions & 2 deletions docsource/modules180-190.rst
Original file line number Diff line number Diff line change
Expand Up @@ -920,7 +920,7 @@ Module coverage 18.0 -> 19.0
+---------------------------------------------------+----------------------+-------------------------------------------------+
| product_matrix | | |
+---------------------------------------------------+----------------------+-------------------------------------------------+
| project | | |
| project |Done | |
+---------------------------------------------------+----------------------+-------------------------------------------------+
| project_account | | |
+---------------------------------------------------+----------------------+-------------------------------------------------+
Expand Down Expand Up @@ -974,7 +974,7 @@ Module coverage 18.0 -> 19.0
+---------------------------------------------------+----------------------+-------------------------------------------------+
| purchase_stock |Done | |
+---------------------------------------------------+----------------------+-------------------------------------------------+
| rating | | |
| rating |Done | |
+---------------------------------------------------+----------------------+-------------------------------------------------+
| repair | | |
+---------------------------------------------------+----------------------+-------------------------------------------------+
Expand Down
2 changes: 2 additions & 0 deletions openupgrade_scripts/apriori.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
"website_membership": "website_crm_partner_assign",
"web_editor": "html_editor",
# odoo/enterprise
# OCA/project
"project_task_add_very_high": "project",
# OCA/...
}

Expand Down
10 changes: 10 additions & 0 deletions openupgrade_scripts/scripts/project/19.0.1.3/end-migration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright 2026 Hunki Enterprises BV
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from openupgradelib import openupgrade


@openupgrade.migrate()
def migrate(env, version):
# set project groups according to features used in projects
env["project.project"]._check_project_group_at_removal()
84 changes: 84 additions & 0 deletions openupgrade_scripts/scripts/project/19.0.1.3/post-migration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# Copyright 2026 Hunki Enterprises BV
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from openupgradelib import openupgrade


def project_project_allow_recurring_tasks(env):
"""
Set project_project#allow_recurring_tasks if there's a recurring task in
project
"""
env.cr.execute(
"""
UPDATE project_project
SET allow_recurring_tasks=True
FROM
project_task
WHERE
project_task.project_id=project_project.id
AND
project_task.recurring_task
"""
)


def project_task_type_rating(env):
"""
Rating related fields have been moved from project.project to project.task.type
Use settings from most recent project
"""
for task_type in env["project.task.type"].search([("project_ids", "!=", False)]):
env.cr.execute(
"""
SELECT
rating_active, rating_request_deadline,
rating_status, rating_status_period
FROM project_project
WHERE id in %s
ORDER BY write_date DESC
LIMIT 1
""",
(tuple(task_type.project_ids.ids),),
)
for vals in env.cr.dictfetchall():
task_type.write(vals)
Comment on lines +31 to +45
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, could you transform all this in one query?



def project_task_priority(env):
"""
Map priorities of "1" (v18 high) to "2" (v19 high), but only if there are no
existing priorities of "2" or "3", pointing to project_task_add_very_high
being installed in v18
"""
env.cr.execute(
"SELECT EXISTS (SELECT id FROM project_task WHERE priority IN ('2', '3'))"
)
if env.cr.fetchone()[0]:
return
env.cr.execute(
"""
UPDATE project_task
SET
priority='2'
WHERE
priority='1'
"""
)


@openupgrade.migrate()
def migrate(env, version):
project_project_allow_recurring_tasks(env)
project_task_type_rating(env)
project_task_priority(env)
openupgrade.load_data(env, "project", "19.0.1.3/noupdate_changes.xml")
openupgrade.delete_record_translations(
env.cr,
"project",
[
"mail_template_data_project_task",
"rating_project_request_email_template",
],
["body_html"],
)
128 changes: 128 additions & 0 deletions openupgrade_scripts/scripts/project/19.0.1.3/upgrade_analysis_work.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
---Models in module 'project'---
new model project.role
new model project.template.create.wizard [transient]
new model project.template.role.to.users.map [transient]
new model task.share.wizard [transient]

# NOTHING TO DO

---Fields in module 'project'---
project / project.milestone / _order : _order is now 'sequence, deadline, is_reached desc, name' ('deadline, is_reached desc, name')
project / project.milestone / sequence (integer) : NEW hasdefault: default

# NOTHING TO DO

project / project.project / allow_recurring_tasks (boolean): NEW

# DONE: set from task recurrence

project / project.project / is_template (boolean) : NEW

# NOTHING TO DO

project / project.project / privacy_visibility (selection): selection_keys added: [invited_users] (most likely nothing to do)

# NOTHING TO DO

project / project.project / rating_active (boolean) : DEL
project / project.project / rating_request_deadline (datetime): DEL
project / project.project / rating_status (selection) : DEL required, selection_keys: ['periodic', 'stage']
project / project.project / rating_status_period (selection): DEL required, selection_keys: ['bimonthly', 'daily', 'monthly', 'quarterly', 'weekly', 'yearly']

# DONE: used to set corresponding fields on project.task.type

project / project.project.stage / color (integer) : NEW
project / project.role / active (boolean) : NEW hasdefault: default
project / project.role / color (integer) : NEW hasdefault: default
project / project.role / name (char) : NEW required, translate
project / project.role / sequence (integer) : NEW
project / project.task / display_in_project (boolean) : now a function
project / project.task / email_from (char) : previously in module website_project
project / project.task / has_template_ancestor (boolean): NEW isfunction: function, stored
project / project.task / is_template (boolean) : NEW
project / project.task / partner_phone (char) : previously in module website_project
project / project.task / personal_stage_type_id (many2one): not a function anymore
project / project.task / personal_stage_type_id (many2one): now related

# NOTHING TO DO

project / project.task / priority (selection) : selection_keys added: [2, 3] (most likely nothing to do)

# DONE: mapped "1" (v18 high) to "2" (v19 high)

project / project.task / role_ids (many2many) : NEW relation: project.role
project / project.task.type / color (integer) : NEW

# NOTHING TO DO

project / project.task.type / rating_active (boolean) : NEW
project / project.task.type / rating_request_deadline (datetime): NEW isfunction: function, stored
project / project.task.type / rating_status (selection) : NEW required, selection_keys: ['periodic', 'stage'], hasdefault: default
project / project.task.type / rating_status_period (selection): NEW required, selection_keys: ['bimonthly', 'daily', 'monthly', 'quarterly', 'weekly', 'yearly'], hasdefault: default

# DONE: set from corresponding fields on project.project

project / project.task.type / rotting_threshold_days (integer): NEW hasdefault: default

# NOTHING TO DO

project / res.users / favorite_project_ids (many2many): NEW relation: project.project

# NOTHING TO DO: inverse of existing project.project#favorite_user_ids

---XML records in module 'project'---
NEW ir.actions.act_window: project.mail_followers_edit_action_from_task
NEW ir.actions.act_window: project.project_milestone_action
NEW ir.actions.act_window: project.project_milestone_action_view_tasks
NEW ir.actions.act_window: project.project_roles_action
NEW ir.actions.act_window.view: project.action_view_project_milestone_form
NEW ir.actions.act_window.view: project.action_view_project_milestone_kanban
NEW ir.actions.act_window.view: project.action_view_project_milestone_list
NEW ir.actions.act_window.view: project.project_milestone_action_view_graph
NEW ir.actions.act_window.view: project.project_milestone_action_view_pivot
NEW ir.actions.act_window.view: project.project_milestone_action_view_tasks_calendar
NEW ir.actions.act_window.view: project.project_milestone_action_view_tasks_kanban
NEW ir.actions.act_window.view: project.project_milestone_action_view_tasks_list
NEW ir.actions.act_window.view: project.project_roles_action_kanban
NEW ir.actions.act_window.view: project.project_roles_action_list
NEW ir.actions.server: project.action_server_convert_project_to_template
NEW ir.actions.server: project.action_server_convert_to_template
DEL ir.actions.server: project.action_server_view_my_task
NEW ir.embedded.actions: project.project_embedded_action_project_milestones
NEW ir.embedded.actions: project.project_embedded_action_update_milestones
NEW ir.model.access: project.access_project_role_manager
NEW ir.model.access: project.access_project_role_user
NEW ir.model.access: project.access_project_task_share_manager
NEW ir.model.access: project.access_project_task_share_user
NEW ir.model.access: project.access_project_template_create_wizard_manager
NEW ir.model.access: project.access_project_template_create_wizard_user
NEW ir.model.access: project.access_project_template_role_to_users_map_manager
NEW ir.model.access: project.access_project_template_role_to_users_map_user
NEW ir.model.constraint: project.constraint_mail_message_date_res_id_id_for_burndown_chart
NEW ir.model.constraint: project.constraint_project_task_is_template_idx
NEW ir.ui.menu: project.project_menu_config_project_roles
NEW ir.ui.view: project.portal_my_tasks_badge_widget_template
NEW ir.ui.view: project.portal_task_share_wizard
NEW ir.ui.view: project.project_milestone_view_kanban
NEW ir.ui.view: project.project_project_view_form_simplified_template
NEW ir.ui.view: project.project_role_view_form
NEW ir.ui.view: project.project_role_view_kanban
NEW ir.ui.view: project.project_role_view_list
NEW ir.ui.view: project.project_role_view_search
NEW ir.ui.view: project.project_task_graph_view_project_milestone
NEW ir.ui.view: project.project_task_kanban_view_project_milestone
NEW ir.ui.view: project.project_task_pivot_view_project_milestone
NEW ir.ui.view: project.project_task_templates_kanban
NEW ir.ui.view: project.project_task_templates_list
NEW ir.ui.view: project.project_task_tree_view_project_milestone
NEW ir.ui.view: project.project_templates_view_form
NEW ir.ui.view: project.project_templates_view_kanban
NEW ir.ui.view: project.project_templates_view_list
NEW ir.ui.view: project.view_task_template_search_form
DEL ir.ui.view: project.project_sharing
DEL ir.ui.view: project.project_sharing_embed
DEL ir.ui.view: project.rating_rating_project_view_kanban
DEL res.groups: project.group_project_rating
NEW res.groups.privilege: project.res_groups_privilege_project

# NOTHING TO DO
9 changes: 9 additions & 0 deletions openupgrade_scripts/scripts/rating/19.0.1.1/post-migration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright 2026 Hunki Enterprises BV
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from openupgradelib import openupgrade


@openupgrade.migrate()
def migrate(env, version):
env.cr.execute("UPDATE rating_rating SET rated_on=write_date")
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---Models in module 'rating'---
---Fields in module 'rating'---
rating / gamification.badge.user / rating_ids (one2many) : NEW relation: rating.rating
rating / ir.actions.server / rating_ids (one2many) : NEW relation: rating.rating
rating / ir.cron / rating_ids (one2many) : NEW relation: rating.rating
rating / maintenance.equipment.category / rating_ids (one2many) : DEL relation: rating.rating
rating / maintenance.team / rating_ids (one2many) : NEW relation: rating.rating

# NOTHING TO DO

rating / rating.rating / rated_on (datetime) : NEW

# DONE: set from write_date

---XML records in module 'rating'---
NEW ir.model.constraint: rating.constraint_rating_rating_consumed_idx
NEW ir.model.constraint: rating.constraint_rating_rating_parent_consumed_idx
DEL ir.ui.view: rating.rating_rating_view_form_complete

# NOTHING TO DO