diff --git a/.github/actions/check-pr-dependency/action.yml b/.github/actions/check-pr-dependency/action.yml new file mode 100644 index 000000000000..7d6e6e2ce121 --- /dev/null +++ b/.github/actions/check-pr-dependency/action.yml @@ -0,0 +1,17 @@ +name: 'Check PR dependencies' +description: 'List PR dependencies in comment, set labels Dependency OK, Blocked by dependency' +inputs: + version: + description: 'OpenUpgrade version' + required: true +branding: + icon: 'git-merge' + color: 'yellow' +runs: + using: "composite" + steps: + - name: 'Run check' + run: | + pip install -r ${{ github.action_path }}/requirements.txt + python ${{ github.action_path }}/check_dependency.py --version ${{ inputs.version }} --repo ${{ github.repository }} --github-login ${{ github.actor }} + shell: sh diff --git a/.github/actions/check-pr-dependency/check_dependency.py b/.github/actions/check-pr-dependency/check_dependency.py new file mode 100644 index 000000000000..2ff3e9d51449 --- /dev/null +++ b/.github/actions/check-pr-dependency/check_dependency.py @@ -0,0 +1,162 @@ +import argparse +import os +import re +from pathlib import Path + +from github import Auth, Github +from github.PullRequestReview import PullRequestReview + +import tools + +parser = argparse.ArgumentParser() +parser.add_argument('--version', nargs='+') +parser.add_argument('--repo', default='OCA/OpenUpgrade') +parser.add_argument('--github-login', default='ocabot') +args = parser.parse_args() + +auth = None +if os.environ.get('GITHUB_TOKEN'): + auth = Auth.Token(os.environ.get('GITHUB_TOKEN')) + +g = Github(auth=auth) +repo = g.get_repo(args.repo) + +# ####################### +# Custom Function +# ####################### +def module_ok(module_name): + return module_coverage[module_name] in ["nothing_to_do", "done"] or opened_prs.get(module_name) == pr_number + +def _extract_migration_comment(migration_message): + if not migration_message: + return "", "", "" + text_reg = ( + r"(?P(\r|\n|.)*)" + r"" + "(?P(\n|.)*)" + r"<\/dependency>" + r"(?P(\r|\n|.)*)" + ) + res = re.match(text_reg, migration_message.body) + if not res: + return "", "", "" + groups = res.groupdict() + return groups["before"], groups["current_text"], groups["after"] + + +def _get_comment_or_review(pr, content): + comments = [x for x in pr.get_issue_comments() if content in x.body] + if comments: + return comments[0] + reviews = [x for x in pr.get_reviews() if content in x.body] + return reviews and reviews[0] or False + + +# #################################### +# Main Script +# #################################### + +for current_version in map(float, args.version): + tools._logger.info(f"*************************************************") + tools._logger.info(f"Update Dependencies for Version {current_version}") + tools._logger.info(f"*************************************************") + + # Get Opened PRs + done_prs, opened_prs = tools._get_prs(repo, current_version) + + # Get Done modules + module_coverage = tools._get_module_coverage(repo, current_version) + + + for module_name, pr_number in opened_prs.items(): + tools._logger.info(f"Handle PR #{pr_number} for module '{module_name}'") + manifest = tools._get_manifest_module(repo, current_version, module_name) + if not manifest: + tools._logger.info(f"the module {module_name} disappeared in the new version.") + continue + + depends = manifest.get("depends") + pr = repo.get_pull(pr_number) + + migration_message = _get_comment_or_review(pr, "ocabot migration") + current_labels = [x.name for x in pr.labels] + new_labels = current_labels.copy() + + log_message = f"PR #{pr_number} for {module_name}:" + if all([module_ok(x) for x in depends]): + # all dependencies are OK, mark the PR as OK. + label_to_remove = "Blocked by dependency" + label_to_add = "Dependency OK" + else: + # mark the PR as blocked + label_to_remove = "Dependency OK" + label_to_add = "Blocked by dependency" + + if label_to_remove in new_labels: + log_message += f" Remove '{label_to_remove}'" + new_labels.remove(label_to_remove) + + if label_to_add not in new_labels: + log_message += f" Set '{label_to_add}'" + new_labels.append(label_to_add) + + if new_labels != current_labels: + tools._logger.info(log_message) + pr.set_labels(*new_labels) + + if not migration_message: + tools._logger.warning(f"Migration message not found in {pr.number}") + continue + + before_text, current_text, after_text = _extract_migration_comment( + migration_message + ) + + dep_modules_ok = [x for x in depends if x in done_prs] + dep_modules_pending = [x for x in depends if x in opened_prs] + dep_modules_ko = [ + x for x in depends if x not in dep_modules_ok + dep_modules_pending + ] + new_text = "" + for dep_module in dep_modules_ok: + new_text += f"\n- {dep_module} : #{done_prs[dep_module]}" + for dep_module in dep_modules_pending: + new_text += f"\n- {dep_module} : #{opened_prs[dep_module]}" + for dep_module in dep_modules_ko: + new_text += f"\n- {dep_module} : TODO" + if module_ok(dep_module): + tools._logger.error(f"{dep_module} not found in the issue 'Migration to version {current_version}'") + + + if new_text: + new_text = "Depends on : \n" + new_text + + new_body = "" + if not current_text and new_text: + tools._logger.info( + f"PR#{pr.number} - {pr.title}: ADDING Text in migration message." + ) + if migration_message.user.login != args.github_login: + tools._logger.warning( + f"The message has been written by @{migration_message.user.login}" + ) + new_body = ( + migration_message.body + "\n\n" + new_text + "" + ) + elif new_text != current_text: + tools._logger.info( + f"PR#{pr.number} - {pr.title}: Replacing text in migration message." + ) + if migration_message.user.login != args.github_login: + tools._logger.warning( + f"The message has been written by @{migration_message.user.login}" + ) + new_body = ( + before_text + "" + new_text + "" + after_text + ) + + if new_body: + if type(migration_message) is PullRequestReview: + tools._logger.warning("Unable to edit the PR due to PyGithub limitation.") + continue + migration_message.edit(new_body) diff --git a/.github/actions/check-pr-dependency/requirements.txt b/.github/actions/check-pr-dependency/requirements.txt new file mode 100644 index 000000000000..945b116ad3c5 --- /dev/null +++ b/.github/actions/check-pr-dependency/requirements.txt @@ -0,0 +1 @@ +PyGithub diff --git a/.github/actions/check-pr-dependency/tools.py b/.github/actions/check-pr-dependency/tools.py new file mode 100644 index 000000000000..27aee3152866 --- /dev/null +++ b/.github/actions/check-pr-dependency/tools.py @@ -0,0 +1,90 @@ +import logging +import re +import sys +import urllib + +logging.basicConfig( + level=logging.INFO, + format="[%(asctime)s] {%(filename)s:%(lineno)d} %(levelname)s - %(message)s", + handlers=[logging.StreamHandler(stream=sys.stdout)], +) + +_logger = logging.getLogger() + + +def _get_prs(repo, version): + opened_prs = {} + done_prs = {} + + line_reg = ( + r"- \[(?P |x)\] (\(del\) )?(\(new\) )?" + r"(?P\w+).*(pull\/|#)(?P\d+)" + ) + issue_title = f"Migration to version {version:.1f}" + + _logger.info(f"Get PRs referenced in '{issue_title}' ...") + # Get main issue to have PRs numbers + for issue in repo.get_issues(): + if issue.title == issue_title: + for line in issue.body.split("\n"): + if not line.startswith("- ["): + continue + res = re.match(line_reg, line) + if not res: + _logger.debug(f"Unable to parse correctly '{line}'") + continue + groups = res.groupdict() + pr_number = int(groups["pr_number"]) + if groups["done"] == "x": + done_prs[groups["module_name"]] = pr_number + else: + opened_prs[groups["module_name"]] = pr_number + _logger.info( + f">> found {len(done_prs)} done PRs" f" and {len(opened_prs)} Opened PRs" + ) + return done_prs, opened_prs + + +def _get_module_coverage(repo, version): + file_name = f"modules{(version - 1) * 10:.0f}-{(version) * 10:.0f}.rst" + url = ( + f"https://raw.githubusercontent.com/OCA/OpenUpgrade" + f"/{version:.1f}/docsource/" + f"{file_name}" + ) + module_coverage = {} + _logger.info(f"Get and parse {file_name} to know coverage state ...") + page = urllib.request.urlopen(url).read().decode() + for line in page.split("\n"): + line = line.replace("|del|", "").replace("|new|", "") + if not line.startswith("|"): + continue + res = line.split("|") + module_name = res[1].strip() + status = res[2].strip() + if module_name == "Module": + continue + if status == "": + module_coverage[module_name] = "to_do" + elif status == "Nothing to do": + module_coverage[module_name] = "nothing_to_do" + elif status.startswith("Done"): + module_coverage[module_name] = "done" + else: + continue + # TODO:fix me + raise Exception("Status '%s' has not been analyzed." % (status)) + _logger.info(f">> found {len(module_coverage)} modules.") + return module_coverage + + +def _get_manifest_module(repo, version, module_name): + url = ( + f"https://raw.githubusercontent.com/odoo/" + f"odoo/{version:.1f}/addons/{module_name}/__manifest__.py" + ) + try: + page = urllib.request.urlopen(url).read().decode() + except urllib.error.HTTPError: + return + return eval(page) diff --git a/.github/workflows/check_pr_dependency.yml b/.github/workflows/check_pr_dependency.yml new file mode 100644 index 000000000000..37c3993d367f --- /dev/null +++ b/.github/workflows/check_pr_dependency.yml @@ -0,0 +1,19 @@ +name: Check PR dependencies + +on: + issues: + types: [edited] + +jobs: + check_dependency: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + if: ${{ github.event.issue.state == 'open' && startsWith( github.event.issue.title, 'Migration to version ' ) }} + - name: Check dependency + if: ${{ github.event.issue.state == 'open' && startsWith( github.event.issue.title, 'Migration to version ' ) }} + uses: ./.github/actions/check-pr-dependency + with: + version: ${{ github.event.issue.milestone.title }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/docsource/modules180-190.rst b/docsource/modules180-190.rst index fd4b86e2175e..ab2ddedec63f 100644 --- a/docsource/modules180-190.rst +++ b/docsource/modules180-190.rst @@ -44,7 +44,7 @@ Module coverage 18.0 -> 19.0 +---------------------------------------------------+----------------------+-------------------------------------------------+ | auth_ldap | |No DB layout changes. | +---------------------------------------------------+----------------------+-------------------------------------------------+ -| auth_oauth | | | +| auth_oauth |Done | | +---------------------------------------------------+----------------------+-------------------------------------------------+ | auth_passkey | | | +---------------------------------------------------+----------------------+-------------------------------------------------+ @@ -112,7 +112,7 @@ Module coverage 18.0 -> 19.0 +---------------------------------------------------+----------------------+-------------------------------------------------+ | contacts |Nothing to do | | +---------------------------------------------------+----------------------+-------------------------------------------------+ -| crm | | | +| crm |Done | | +---------------------------------------------------+----------------------+-------------------------------------------------+ | crm_iap_enrich | |No DB layout changes. | +---------------------------------------------------+----------------------+-------------------------------------------------+ @@ -134,7 +134,7 @@ Module coverage 18.0 -> 19.0 +---------------------------------------------------+----------------------+-------------------------------------------------+ | digest |Done |No DB layout changes. | +---------------------------------------------------+----------------------+-------------------------------------------------+ -| event | | | +| event |Done | | +---------------------------------------------------+----------------------+-------------------------------------------------+ | event_booth | | | +---------------------------------------------------+----------------------+-------------------------------------------------+ @@ -144,7 +144,7 @@ Module coverage 18.0 -> 19.0 +---------------------------------------------------+----------------------+-------------------------------------------------+ | event_crm_sale | | | +---------------------------------------------------+----------------------+-------------------------------------------------+ -| event_product | | | +| event_product |Done | | +---------------------------------------------------+----------------------+-------------------------------------------------+ | event_sale | | | +---------------------------------------------------+----------------------+-------------------------------------------------+ @@ -194,7 +194,7 @@ Module coverage 18.0 -> 19.0 +---------------------------------------------------+----------------------+-------------------------------------------------+ | hr_livechat | | | +---------------------------------------------------+----------------------+-------------------------------------------------+ -| hr_maintenance | | | +| hr_maintenance |Nothing to do | | +---------------------------------------------------+----------------------+-------------------------------------------------+ | hr_org_chart |Nothing to do | | +---------------------------------------------------+----------------------+-------------------------------------------------+ @@ -390,9 +390,9 @@ Module coverage 18.0 -> 19.0 +---------------------------------------------------+----------------------+-------------------------------------------------+ | l10n_fi_sale | | | +---------------------------------------------------+----------------------+-------------------------------------------------+ -| l10n_fr | | | +| l10n_fr |Done | | +---------------------------------------------------+----------------------+-------------------------------------------------+ -| l10n_fr_account | | | +| l10n_fr_account |Nothing to do | | +---------------------------------------------------+----------------------+-------------------------------------------------+ | l10n_fr_facturx_chorus_pro | |No DB layout changes. | +---------------------------------------------------+----------------------+-------------------------------------------------+ @@ -706,19 +706,19 @@ Module coverage 18.0 -> 19.0 +---------------------------------------------------+----------------------+-------------------------------------------------+ | mail_bot | | | +---------------------------------------------------+----------------------+-------------------------------------------------+ -| mail_bot_hr | | | +| mail_bot_hr |Nothing to do | | +---------------------------------------------------+----------------------+-------------------------------------------------+ | mail_group | | | +---------------------------------------------------+----------------------+-------------------------------------------------+ | mail_plugin | |No DB layout changes. | +---------------------------------------------------+----------------------+-------------------------------------------------+ -| maintenance | | | +| maintenance |Done | | +---------------------------------------------------+----------------------+-------------------------------------------------+ | marketing_card | | | +---------------------------------------------------+----------------------+-------------------------------------------------+ | mass_mailing |Done | | +---------------------------------------------------+----------------------+-------------------------------------------------+ -| mass_mailing_crm | |No DB layout changes. | +| mass_mailing_crm |Nothing to do |No DB layout changes. | +---------------------------------------------------+----------------------+-------------------------------------------------+ | mass_mailing_crm_sms | |No DB layout changes. | +---------------------------------------------------+----------------------+-------------------------------------------------+ @@ -746,7 +746,7 @@ Module coverage 18.0 -> 19.0 +---------------------------------------------------+----------------------+-------------------------------------------------+ | microsoft_calendar | |No DB layout changes. | +---------------------------------------------------+----------------------+-------------------------------------------------+ -| microsoft_outlook | | | +| microsoft_outlook |Nothing to do | | +---------------------------------------------------+----------------------+-------------------------------------------------+ | mrp |Done | | +---------------------------------------------------+----------------------+-------------------------------------------------+ @@ -814,7 +814,7 @@ Module coverage 18.0 -> 19.0 +---------------------------------------------------+----------------------+-------------------------------------------------+ | |new| payment_redsys | | | +---------------------------------------------------+----------------------+-------------------------------------------------+ -| payment_stripe | | | +| payment_stripe |Nothing to do | | +---------------------------------------------------+----------------------+-------------------------------------------------+ | payment_worldline | | | +---------------------------------------------------+----------------------+-------------------------------------------------+ @@ -990,11 +990,11 @@ Module coverage 18.0 -> 19.0 +---------------------------------------------------+----------------------+-------------------------------------------------+ | |del| sale_async_emails | | | +---------------------------------------------------+----------------------+-------------------------------------------------+ -| sale_crm | | | +| sale_crm |Nothing to do | | +---------------------------------------------------+----------------------+-------------------------------------------------+ | sale_edi_ubl | | | +---------------------------------------------------+----------------------+-------------------------------------------------+ -| sale_expense | | | +| sale_expense |Done | | +---------------------------------------------------+----------------------+-------------------------------------------------+ | sale_expense_margin | |No DB layout changes. | +---------------------------------------------------+----------------------+-------------------------------------------------+ @@ -1098,13 +1098,13 @@ Module coverage 18.0 -> 19.0 +---------------------------------------------------+----------------------+-------------------------------------------------+ | stock_landed_costs | | | +---------------------------------------------------+----------------------+-------------------------------------------------+ -| |new| stock_maintenance | | | +| |new| stock_maintenance |Nothing to do | | +---------------------------------------------------+----------------------+-------------------------------------------------+ -| stock_picking_batch | | | +| stock_picking_batch |Nothing to do | | +---------------------------------------------------+----------------------+-------------------------------------------------+ | stock_sms | | | +---------------------------------------------------+----------------------+-------------------------------------------------+ -| survey | | | +| survey |Done | | +---------------------------------------------------+----------------------+-------------------------------------------------+ | |new| survey_crm | | | +---------------------------------------------------+----------------------+-------------------------------------------------+ @@ -1128,11 +1128,11 @@ Module coverage 18.0 -> 19.0 +---------------------------------------------------+----------------------+-------------------------------------------------+ | website |Done | | +---------------------------------------------------+----------------------+-------------------------------------------------+ -| website_blog | | | +| website_blog |Done | | +---------------------------------------------------+----------------------+-------------------------------------------------+ -| website_cf_turnstile | | | +| website_cf_turnstile |Nothing to do | | +---------------------------------------------------+----------------------+-------------------------------------------------+ -| website_crm | |No DB layout changes. | +| website_crm |Nothing to do |No DB layout changes. | +---------------------------------------------------+----------------------+-------------------------------------------------+ | website_crm_iap_reveal | | | +---------------------------------------------------+----------------------+-------------------------------------------------+ @@ -1176,9 +1176,9 @@ Module coverage 18.0 -> 19.0 +---------------------------------------------------+----------------------+-------------------------------------------------+ | website_forum | | | +---------------------------------------------------+----------------------+-------------------------------------------------+ -| website_google_map | | | +| website_google_map |Nothing to do | | +---------------------------------------------------+----------------------+-------------------------------------------------+ -| website_hr_recruitment | | | +| website_hr_recruitment |Done | | +---------------------------------------------------+----------------------+-------------------------------------------------+ | |new| website_hr_recruitment_livechat | | | +---------------------------------------------------+----------------------+-------------------------------------------------+ @@ -1204,9 +1204,9 @@ Module coverage 18.0 -> 19.0 +---------------------------------------------------+----------------------+-------------------------------------------------+ | |del| website_payment_authorize | | | +---------------------------------------------------+----------------------+-------------------------------------------------+ -| website_profile | | | +| website_profile |Done | | +---------------------------------------------------+----------------------+-------------------------------------------------+ -| website_project | | | +| website_project |Nothing to do | | +---------------------------------------------------+----------------------+-------------------------------------------------+ | website_sale |Done | | +---------------------------------------------------+----------------------+-------------------------------------------------+ diff --git a/openupgrade_scripts/scripts/account_edi_ubl_cii/19.0.1.0/pre-migration.py b/openupgrade_scripts/scripts/account_edi_ubl_cii/19.0.1.0/pre-migration.py index 9347b84a788c..eb2d841f220f 100644 --- a/openupgrade_scripts/scripts/account_edi_ubl_cii/19.0.1.0/pre-migration.py +++ b/openupgrade_scripts/scripts/account_edi_ubl_cii/19.0.1.0/pre-migration.py @@ -19,10 +19,16 @@ @openupgrade.migrate() def migrate(env, version): - openupgrade.map_values( - env.cr, - "ubl_cii_tax_exemption_reason_code", - "ubl_cii_tax_exemption_reason_code", - _reason_code_map, - table="account_tax", - ) + # ubl_cii_tax_exemption_reason_code came from account_edi_ubl_cii_tax_extension + # (not auto-installed in 18.0), merged into this module in 19.0. DBs without + # that extension lack the column, so guard the remap. + if openupgrade.column_exists( + env.cr, "account_tax", "ubl_cii_tax_exemption_reason_code" + ): + openupgrade.map_values( + env.cr, + "ubl_cii_tax_exemption_reason_code", + "ubl_cii_tax_exemption_reason_code", + _reason_code_map, + table="account_tax", + ) diff --git a/openupgrade_scripts/scripts/auth_oauth/19.0.1.0/post-migration.py b/openupgrade_scripts/scripts/auth_oauth/19.0.1.0/post-migration.py new file mode 100644 index 000000000000..2968ad620b70 --- /dev/null +++ b/openupgrade_scripts/scripts/auth_oauth/19.0.1.0/post-migration.py @@ -0,0 +1,16 @@ +# Copyright 2026 Tecnativa - Carlos Lopez +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + + +from openupgradelib import openupgrade + + +@openupgrade.migrate() +def migrate(env, version): + openupgrade.load_data(env, "auth_oauth", "19.0.1.0/noupdate_changes.xml") + openupgrade.delete_record_translations( + env.cr, + "auth_oauth", + ["provider_facebook", "provider_google", "provider_openerp"], + ["body"], + ) diff --git a/openupgrade_scripts/scripts/auth_oauth/19.0.1.0/upgrade_analysis_work.txt b/openupgrade_scripts/scripts/auth_oauth/19.0.1.0/upgrade_analysis_work.txt new file mode 100644 index 000000000000..d902478d7802 --- /dev/null +++ b/openupgrade_scripts/scripts/auth_oauth/19.0.1.0/upgrade_analysis_work.txt @@ -0,0 +1,8 @@ +---Models in module 'auth_oauth'--- +---Fields in module 'auth_oauth'--- +---XML records in module 'auth_oauth'--- +DEL ir.ui.view: auth_oauth.login +DEL ir.ui.view: auth_oauth.reset_password +DEL ir.ui.view: auth_oauth.signup +DEL ir.ui.view: auth_oauth.view_users_form +# NOTHING TO DO: Handled by ORM diff --git a/openupgrade_scripts/scripts/base/19.0.1.3/end-migration.py b/openupgrade_scripts/scripts/base/19.0.1.3/end-migration.py new file mode 100644 index 000000000000..1be8d0c4f145 --- /dev/null +++ b/openupgrade_scripts/scripts/base/19.0.1.3/end-migration.py @@ -0,0 +1,9 @@ +# Copyright 2026 Tecnativa - Pedro M. Baeza +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from openupgradelib import openupgrade + + +@openupgrade.migrate() +def migrate(env, version): + openupgrade.disable_invalid_filters(env) diff --git a/openupgrade_scripts/scripts/base/19.0.1.3/pre-migration.py b/openupgrade_scripts/scripts/base/19.0.1.3/pre-migration.py index 39b145615b4b..1a1c7f57fa51 100644 --- a/openupgrade_scripts/scripts/base/19.0.1.3/pre-migration.py +++ b/openupgrade_scripts/scripts/base/19.0.1.3/pre-migration.py @@ -170,9 +170,109 @@ def migrate(env, version): } AS (SELECT name, state FROM ir_module_module); """, ) - openupgrade.update_module_names(env.cr, renamed_modules.items()) - openupgrade.update_module_names(env.cr, merged_modules.items(), merge_modules=True) + openupgrade.update_module_names( + env.cr, renamed_modules.items(), environment_namespec=True + ) + openupgrade.update_module_names( + env.cr, merged_modules.items(), merge_modules=True, environment_namespec=True + ) openupgrade.clean_transient_models(env.cr) openupgrade.rename_xmlids(env.cr, _renamed_xmlids) openupgrade.rename_xmlids(env.cr, _merged_xmlids, allow_merge=True) openupgrade.rename_fields(env, _renamed_fields) + _fix_user_groups_id_references(env) + _strip_removed_search_view_attrs(env) + + +def _fix_user_groups_id_references(env): + """rename_fields() renames the field column on res_users and quoted + references in ir.filters.domain, but it does not process ir.rule + domain_force, server-action code, or unquoted dotted references like + ``user.groups_id.ids`` in Python-evaluated domain expressions — those + crash at evaluation time with ``AttributeError: 'res.users' object has + no attribute 'groups_id'``. + + 18.0's stored groups_id held the TRANSITIVE group set; 19.0 splits it + into group_ids (explicitly assigned only) and all_group_ids (the + closure). The faithful rewrite — for the dotted user reference and for + the LHS of res.users-scoped domains alike — is all_group_ids, matching + how 19.0 core rewrote its own rule data (e.g. mail_group). + """ + for table, column in ( + ("ir_rule", "domain_force"), + ("ir_filters", "domain"), + ("ir_act_server", "code"), + ): + openupgrade.logged_query( + env.cr, + rf""" + UPDATE {table} + SET {column} = regexp_replace( + {column}, '\muser\.groups_id\M', 'user.all_group_ids', 'g' + ) + WHERE {column} ~ '\muser\.groups_id\M' + """, + ) + # the LHS of res.users-scoped rule/filter domains: 18's groups_id closure + # maps to all_group_ids + openupgrade.logged_query( + env.cr, + r""" + UPDATE ir_rule r + SET domain_force = regexp_replace( + domain_force, '([''"])groups_id\1', '\1all_group_ids\1', 'g' + ) + FROM ir_model m + WHERE m.id = r.model_id + AND m.model = 'res.users' + AND r.domain_force ~ '([''"])groups_id\1' + """, + ) + openupgrade.logged_query( + env.cr, + r""" + UPDATE ir_filters + SET domain = regexp_replace( + domain, '([''"])groups_id\1', '\1all_group_ids\1', 'g' + ) + WHERE model_id = 'res.users' + AND domain ~ '([''"])groups_id\1' + """, + ) + + +def _strip_removed_search_view_attrs(env): + """Strip 19.0 RNG-removed attrs (`expand=` on /, + `string="Group By"` on ) from stored search-view arch_db. + """ + openupgrade.logged_query( + env.cr, + r""" + UPDATE ir_ui_view v + SET arch_db = sub.new_arch + FROM ( + SELECT id, + jsonb_object_agg( + lang, + to_jsonb( + regexp_replace( + regexp_replace(content, + '(<(?:group|field)[^>]*?)\s+expand="[^"]*"', + '\1', 'g'), + '(]*?)\s+string="Group By"', + '\1', 'g' + ) + ) + ) AS new_arch + FROM ( + SELECT v2.id, je.key AS lang, je.value #>> '{}' AS content + FROM ir_ui_view v2, jsonb_each(v2.arch_db) je + WHERE v2.type='search' + AND (v2.arch_db::text LIKE '%%expand=%%' + OR v2.arch_db::text LIKE '%%string="Group By"%%') + ) flat + GROUP BY id + ) sub + WHERE v.id = sub.id + """, + ) diff --git a/openupgrade_scripts/scripts/base/tests/data_base_migration.py b/openupgrade_scripts/scripts/base/tests/data_base_migration.py index 472065b36553..6c5278073116 100644 --- a/openupgrade_scripts/scripts/base/tests/data_base_migration.py +++ b/openupgrade_scripts/scripts/base/tests/data_base_migration.py @@ -41,4 +41,42 @@ ], } ) + +# Search-view fixtures for the 19.0 RNG attribute strip helper. +# `expand=` on / and `string="Group By"` on +# were valid in 18.0 but rejected by 19.0's stricter RelaxNG schema. +env["ir.ui.view"].create( + { + "name": "test search group_expand", + "model": "res.partner", + "type": "search", + "arch": """ + + + + + + + """, + } +) +env["ir.ui.view"].create( + { + "name": "test search field_expand", + "model": "res.partner", + "type": "search", + "arch": """ + + + + + + + """, + } +) env.cr.commit() diff --git a/openupgrade_scripts/scripts/base/tests/test_base_migration.py b/openupgrade_scripts/scripts/base/tests/test_base_migration.py index 525218394f51..80a67cc9909d 100644 --- a/openupgrade_scripts/scripts/base/tests/test_base_migration.py +++ b/openupgrade_scripts/scripts/base/tests/test_base_migration.py @@ -24,3 +24,41 @@ def test_server_action_child_ids(self): action2.child_ids.mapped("name"), ("child action 1", "child action 2", "child action 3"), ) + + def test_strip_removed_search_view_attrs(self): + """19.0 RNG-removed attrs (`expand=` on /, + `string="Group By"` on ) are stripped from arch_db + on search views; legitimate attrs are preserved. + """ + view_group = self.env["ir.ui.view"].search( + [("name", "=", "test search group_expand")] + ) + self.assertTrue(view_group) + arch_group = view_group.arch_db + self.assertNotIn( + 'expand="0"', + arch_group, + "expand= should be stripped from in search arch", + ) + self.assertNotIn( + 'string="Group By"', + arch_group, + 'string="Group By" should be stripped from ', + ) + # Legit attrs preserved + self.assertIn('name="country"', arch_group) + self.assertIn('string="Country"', arch_group) + + view_field = self.env["ir.ui.view"].search( + [("name", "=", "test search field_expand")] + ) + self.assertTrue(view_field) + arch_field = view_field.arch_db + self.assertNotIn( + 'expand="1"', + arch_field, + "expand= should be stripped from in searchpanel", + ) + # Legit attrs preserved + self.assertIn('select="multi"', arch_field) + self.assertIn('name="country_id"', arch_field) diff --git a/openupgrade_scripts/scripts/crm/19.0.1.9/post-migration.py b/openupgrade_scripts/scripts/crm/19.0.1.9/post-migration.py new file mode 100644 index 000000000000..9b1da761b977 --- /dev/null +++ b/openupgrade_scripts/scripts/crm/19.0.1.9/post-migration.py @@ -0,0 +1,54 @@ +# Copyright 2026 Tecnativa - Eduardo Ezerouali +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +from openupgradelib import openupgrade + + +def _migrate_lead_mobile(env): + openupgrade.logged_query( + env.cr, + """ + UPDATE crm_lead + SET phone = CONCAT(COALESCE(phone, ''), mobile) + WHERE COALESCE(mobile, '') != '' + """, + ) + + +def _load_data_pls_fields_param(env): + # New PLS fields added in v19. Merge them into the existing value instead of + # overwriting it, so a customized/removed `crm.pls_fields` param is preserved + new_fields = {"state_id", "country_id", "source_id", "lang_id", "tag_ids"} + param = env["ir.config_parameter"].sudo().get_param("crm.pls_fields") + if param: + current = set(param.split(",")) + merged = current | new_fields + env["ir.config_parameter"].sudo().set_param( + "crm.pls_fields", ",".join(sorted(merged)) + ) + + +def _load_data_stage_colors(env): + # Only color the default stages that still exist, + # skip any the user deleted in v18. + colors = { + "stage_lead1": 11, + "stage_lead2": 5, + "stage_lead3": 8, + "stage_lead4": 10, + } + for xml_id, color in colors.items(): + record = env.ref(f"crm.{xml_id}", raise_if_not_found=False) + if record: + record.color = color + + +@openupgrade.migrate() +def migrate(env, version): + # Do not load noupdate_changes.xml: every entry is problematic (deleted stages, + # customized pls param). the necessary changes are done manually in + # the _load_data_* functions below + + openupgrade.m2o_to_x2m(env.cr, env["crm.stage"], "crm_stage", "team_ids", "team_id") + _load_data_stage_colors(env) + _load_data_pls_fields_param(env) + _migrate_lead_mobile(env) diff --git a/openupgrade_scripts/scripts/crm/19.0.1.9/pre-migration.py b/openupgrade_scripts/scripts/crm/19.0.1.9/pre-migration.py new file mode 100644 index 000000000000..35ab30cea9d0 --- /dev/null +++ b/openupgrade_scripts/scripts/crm/19.0.1.9/pre-migration.py @@ -0,0 +1,38 @@ +# Copyright 2026 Tecnativa - Eduardo Ezerouali +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +from openupgradelib import openupgrade + + +def _won_status_set(env): + # Precreate won_status and set with sql + openupgrade.add_columns( + env, + [ + ("crm.lead", "won_status", "selection", "pending", "crm_lead"), + ], + ) + openupgrade.logged_query( + env.cr, + """ + UPDATE crm_lead cl + SET won_status = 'won' + FROM crm_stage cs + WHERE cs.id = cl.stage_id + AND cs.is_won + AND cl.probability = 100 + """, + ) + openupgrade.logged_query( + env.cr, + """ + UPDATE crm_lead cl + SET won_status = 'lost' + WHERE NOT cl.active + AND cl.probability = 0 + """, + ) + + +@openupgrade.migrate() +def migrate(env, version): + _won_status_set(env) diff --git a/openupgrade_scripts/scripts/crm/19.0.1.9/upgrade_analysis_work.txt b/openupgrade_scripts/scripts/crm/19.0.1.9/upgrade_analysis_work.txt new file mode 100644 index 000000000000..6012c880ff01 --- /dev/null +++ b/openupgrade_scripts/scripts/crm/19.0.1.9/upgrade_analysis_work.txt @@ -0,0 +1,37 @@ +---Models in module 'crm'--- +---Fields in module 'crm'--- +crm / crm.lead / commercial_partner_id (many2one): NEW relation: res.partner, hasdefault: compute, stored: False +# NOTHING TO DO + +crm / crm.lead / mobile (char) : DEL +# DONE: pos-migration: if phone is empty and mobile not set phone with mobile and concatenate the mobile in the pone field in case both exist + +crm / crm.lead / title (many2one) : DEL relation: res.partner.title +# NOTHING TO DO + +crm / crm.lead / won_status (selection) : NEW selection_keys: ['lost', 'pending', 'won'], isfunction: function, stored +# DONE: pre-migration: pre-created column and set it to prevent massive computation + +crm / crm.lead.scoring.frequency.field / color (integer) : NEW hasdefault: default +crm / crm.stage / color (integer) : NEW +# NOTHING TO DO + +crm / crm.stage / rotting_threshold_days (integer): NEW hasdefault: default +# NOTHING TO DO: default is set to 0 to keep old behavoir + +crm / crm.stage / team_id (many2one) : DEL relation: crm.team +crm / crm.stage / team_ids (many2many) : NEW relation: crm.team +# Done: post-migration: Transform m2o to m2m + +crm / crm.team.member / assignment_domain_preferred (char): NEW +crm / res.users / target_sales_done (integer) : DEL +crm / res.users / target_sales_won (integer) : DEL +# NOTHING TO DO + +---XML records in module 'crm'--- +NEW ir.actions.act_window: crm.mail_followers_edit_action_from_lead +NEW ir.model.constraint: crm.constraint_crm_lead_create_date_team_id_idx +NEW ir.model.constraint: crm.constraint_crm_lead_default_order_idx +NEW ir.model.constraint: crm.constraint_crm_lead_user_id_team_id_type_index +DEL ir.ui.view: crm.crm_lead_partner_kanban_view +# NOTHING TO DO diff --git a/openupgrade_scripts/scripts/event/19.0.1.9/noupdate_changes-transformation.xml b/openupgrade_scripts/scripts/event/19.0.1.9/noupdate_changes-transformation.xml new file mode 100644 index 000000000000..6dd926785167 --- /dev/null +++ b/openupgrade_scripts/scripts/event/19.0.1.9/noupdate_changes-transformation.xml @@ -0,0 +1,9 @@ + + + + + diff --git a/openupgrade_scripts/scripts/event/19.0.1.9/post-migration.py b/openupgrade_scripts/scripts/event/19.0.1.9/post-migration.py new file mode 100644 index 000000000000..830788ac60e5 --- /dev/null +++ b/openupgrade_scripts/scripts/event/19.0.1.9/post-migration.py @@ -0,0 +1,51 @@ +# Copyright 2026 Hunki Enterprises BV +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from openupgradelib import openupgrade + + +def event_question(env): + """ + Convert event_id, event_type_id to their many2many equivalents + """ + openupgrade.m2o_to_x2m( + env.cr, env["event.question"], "event_question", "event_ids", "event_id" + ) + openupgrade.m2o_to_x2m( + env.cr, + env["event.question"], + "event_question", + "event_type_ids", + "event_type_id", + ) + + +def adjust_cron_interval(env): + """ + If the event mail cron has been left at default settings, use new default + """ + cron = env.ref("event.event_mail_scheduler") + if cron and cron.interval_number == 1 and cron.interval_type == "hours": + cron.interval_number = 24 + + +@openupgrade.migrate() +def migrate(env, version): + openupgrade.load_data( + env, + "event", + "19.0.1.9/noupdate_changes.xml", + xml_transformation_filename="19.0.1.9/noupdate_changes-transformation.xml", + ) + openupgrade.delete_record_translations( + env.cr, + "event", + [ + "event_registration_mail_template_badge", + "event_reminder", + "event_subscription", + ], + ["body_html"], + ) + event_question(env) + adjust_cron_interval(env) diff --git a/openupgrade_scripts/scripts/event/19.0.1.9/pre-migration.py b/openupgrade_scripts/scripts/event/19.0.1.9/pre-migration.py new file mode 100644 index 000000000000..e0b39b55a5c8 --- /dev/null +++ b/openupgrade_scripts/scripts/event/19.0.1.9/pre-migration.py @@ -0,0 +1,44 @@ +# Copyright 2026 Hunki Enterprises BV +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from openupgradelib import openupgrade + +_copy_columns = { + "event_event": [ + ("badge_format", None, None), + ] +} + +_added_fields = [ + ("event_url", "event.event", "event_event", "char", None, "event"), + ("is_default", "event.question", "event_question", "boolean", None, "event", False), + ( + "is_reusable", + "event.question", + "event_question", + "boolean", + None, + "event", + False, + ), +] + + +def event_event_badge_format(env): + """ + Remap badge printer formats to four_per_sheet + """ + openupgrade.map_values( + env.cr, + "badge_format", + "badge_format", + [("96x134", "four_per_sheet"), ("96x82", "four_per_sheet")], + table="event_event", + ) + + +@openupgrade.migrate() +def migrate(env, version): + openupgrade.copy_columns(env.cr, _copy_columns) + openupgrade.add_fields(env, _added_fields) + event_event_badge_format(env) diff --git a/openupgrade_scripts/scripts/event/19.0.1.9/upgrade_analysis_work.txt b/openupgrade_scripts/scripts/event/19.0.1.9/upgrade_analysis_work.txt new file mode 100644 index 000000000000..43d76f35609f --- /dev/null +++ b/openupgrade_scripts/scripts/event/19.0.1.9/upgrade_analysis_work.txt @@ -0,0 +1,126 @@ +---Models in module 'event'--- +new model event.mail.slot +new model event.slot + +# NOTHING TO DO: new funcitonality + +---Fields in module 'event'--- +event / event.event / badge_format (selection) : selection_keys removed: [96x134, 96x82] + +# DONE: mapped keys to four_per_sheet in pre-migration + +event / event.event / event_slot_ids (one2many) : NEW relation: event.slot + +# NOTHING TO DO + +event / event.event / event_url (char) : NEW hasdefault: compute + +# DONE: initialized with null to avoid computation in pre-migration + +event / event.event / general_question_ids (one2many): table is now 'event_event_event_question_rel' ('False') +event / event.event / general_question_ids (one2many): type is now 'many2many' ('one2many') + +# DONE: converted to many2many in post-migration + +event / event.event / is_multi_slots (boolean) : NEW +event / event.event / kanban_state (selection) : selection_keys added: [cancel] (most likely nothing to do) +event / event.event / kanban_state_label (char) : DEL + +# NOTHING TO DO + +event / event.event / question_ids (one2many) : table is now 'event_event_event_question_rel' ('False') +event / event.event / question_ids (one2many) : type is now 'many2many' ('one2many') +event / event.event / specific_question_ids (one2many): table is now 'event_event_event_question_rel' ('False') +event / event.event / specific_question_ids (one2many): type is now 'many2many' ('one2many') + +# DONE: converted to many2many in post-migration + +event / event.event.ticket / limit_max_per_order (integer) : NEW hasdefault: default + +# NOTHING TO DO + +event / event.mail / error_datetime (datetime) : NEW +event / event.mail / interval_type (selection) : selection_keys added: [after_event_start, before_event_end] (most likely nothing to do) +event / event.mail / mail_slot_ids (one2many) : NEW relation: event.mail.slot +event / event.mail / mail_state (selection) : selection_keys added: [cancelled, error] (most likely nothing to do) +event / event.mail.slot / event_slot_id (many2one) : NEW relation: event.slot, required +event / event.mail.slot / last_registration_id (many2one): NEW relation: event.registration +event / event.mail.slot / mail_count_done (integer) : NEW +event / event.mail.slot / mail_done (boolean) : NEW +event / event.mail.slot / scheduled_date (datetime) : NEW isfunction: function, stored +event / event.mail.slot / scheduler_id (many2one) : NEW relation: event.mail, required +event / event.question / active (boolean) : NEW hasdefault: default + +# NOTHING TO DO + +event / event.question / event_id (many2one) : DEL relation: event.event +event / event.question / event_ids (many2many) : NEW relation: event.event +event / event.question / event_type_id (many2one) : DEL relation: event.type +event / event.question / event_type_ids (many2many) : NEW relation: event.type + +# DONE: converted in post-migration + +event / event.question / is_default (boolean) : NEW +event / event.question / is_reusable (boolean) : NEW isfunction: function, stored + +# DONE: precreated with value False in pre-migration + +event / event.registration / event_begin_date (datetime) : not related anymore +event / event.registration / event_begin_date (datetime) : now a function +event / event.registration / event_end_date (datetime) : not related anymore +event / event.registration / event_end_date (datetime) : now a function + +# NOTHING TO DO: nonstored + +event / event.registration / event_slot_id (many2one) : NEW relation: event.slot +event / event.slot / color (integer) : NEW hasdefault: default +event / event.slot / date (date) : NEW required +event / event.slot / end_datetime (datetime) : NEW isfunction: function, stored +event / event.slot / end_hour (float) : NEW required +event / event.slot / event_id (many2one) : NEW relation: event.event, required +event / event.slot / registration_ids (one2many) : NEW relation: event.registration +event / event.slot / start_datetime (datetime) : NEW isfunction: function, stored +event / event.slot / start_hour (float) : NEW required +event / event.stage / legend_blocked (char) : DEL required +event / event.stage / legend_done (char) : DEL required +event / event.stage / legend_normal (char) : DEL required + +# NOTHING TO DO + +event / event.type / question_ids (one2many) : table is now 'event_question_event_type_rel' ('False') +event / event.type / question_ids (one2many) : type is now 'many2many' ('one2many') + +# DONE: converted to many2many in post-migration + +event / event.type.mail / interval_type (selection) : selection_keys added: [after_event_start, before_event_end] (most likely nothing to do) + +# NOTHING TO DO + +---XML records in module 'event'--- +NEW event.question: event.event_question_email (noupdate) +NEW event.question: event.event_question_name (noupdate) +NEW event.question: event.event_question_phone (noupdate) +DEL event.stage: event.event_stage_cancelled (noupdate) +NEW ir.actions.act_window: event.event_question_action +NEW ir.actions.act_window: event.event_slot_action_from_event +DEL ir.actions.client: event.event_action_install_kiosk_pwa +DEL ir.actions.report: event.action_report_event_registration_badge_96x134 +DEL ir.actions.report: event.action_report_event_registration_badge_96x82 +NEW ir.model.access: event.access_event_mail_slot_manager +NEW ir.model.access: event.access_event_mail_slot_registration +NEW ir.model.access: event.access_event_slot_registration +NEW ir.model.access: event.access_event_slot_user +NEW ir.model.constraint: event.constraint_event_question_check_default_question_is_reusable +NEW ir.ui.menu: event.event_question_menu +NEW ir.ui.view: event.event_question_view_list +NEW ir.ui.view: event.event_question_view_list_add +NEW ir.ui.view: event.event_question_view_search +NEW ir.ui.view: event.view_event_slot_calendar +NEW ir.ui.view: event.view_event_slot_form +NEW ir.ui.view: event.view_event_slot_multi_create_form +NEW ir.ui.view: event.view_event_slot_tree +DEL ir.ui.view: event.event_report_template_esc_label_96x134_badge +DEL ir.ui.view: event.event_report_template_esc_label_96x82_badge +NEW res.groups.privilege: event.res_groups_privilege_events + +# NOTHING TO DO diff --git a/openupgrade_scripts/scripts/event_product/19.0.1.0/post-migration.py b/openupgrade_scripts/scripts/event_product/19.0.1.0/post-migration.py new file mode 100644 index 000000000000..de860f043801 --- /dev/null +++ b/openupgrade_scripts/scripts/event_product/19.0.1.0/post-migration.py @@ -0,0 +1,9 @@ +# Copyright 2026 Tecnativa - Pilar Vargas +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from openupgradelib import openupgrade + + +@openupgrade.migrate() +def migrate(env, version): + openupgrade.load_data(env, "event_product", "19.0.1.0/noupdate_changes.xml") diff --git a/openupgrade_scripts/scripts/event_product/19.0.1.0/upgrade_analysis_work.txt b/openupgrade_scripts/scripts/event_product/19.0.1.0/upgrade_analysis_work.txt new file mode 100644 index 000000000000..95e692e4ab04 --- /dev/null +++ b/openupgrade_scripts/scripts/event_product/19.0.1.0/upgrade_analysis_work.txt @@ -0,0 +1,10 @@ +---Models in module 'event_product'--- +---Fields in module 'event_product'--- +event_product / event.registration / sale_status (selection) : previously in module event_sale +# NOTHING TO DO: no changes + +---XML records in module 'event_product'--- +NEW ir.ui.view: event_product.event_registration_ticket_view_form +NEW ir.ui.view: event_product.event_registration_view_graph +NEW ir.ui.view: event_product.view_event_registration_ticket_tree +# NOTHING TO DO diff --git a/openupgrade_scripts/scripts/hr_maintenance/19.0.1.0/upgrade_analysis_work.txt b/openupgrade_scripts/scripts/hr_maintenance/19.0.1.0/upgrade_analysis_work.txt new file mode 100644 index 000000000000..7006cdcf0f25 --- /dev/null +++ b/openupgrade_scripts/scripts/hr_maintenance/19.0.1.0/upgrade_analysis_work.txt @@ -0,0 +1,9 @@ +---Models in module 'hr_maintenance'--- +---Fields in module 'hr_maintenance'--- +hr_maintenance / res.users / equipment_ids (one2many) : DEL relation: maintenance.equipment +# NOTHING TO DO: Handled by ORM + +---XML records in module 'hr_maintenance'--- +NEW ir.ui.view: hr_maintenance.hr_employee_public_view_form +DEL ir.ui.view: hr_maintenance.res_users_view_form_preference +# NOTHING TO DO: Handled by ORM diff --git a/openupgrade_scripts/scripts/l10n_fr/19.0.2.1/post-migration.py b/openupgrade_scripts/scripts/l10n_fr/19.0.2.1/post-migration.py new file mode 100644 index 000000000000..1bf575e06312 --- /dev/null +++ b/openupgrade_scripts/scripts/l10n_fr/19.0.2.1/post-migration.py @@ -0,0 +1,9 @@ +# Copyright 2026 Tecnativa - Pilar Vargas +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from openupgradelib import openupgrade + + +@openupgrade.migrate() +def migrate(env, version): + openupgrade.load_data(env, "l10n_fr", "19.0.2.1/noupdate_changes.xml") diff --git a/openupgrade_scripts/scripts/l10n_fr/19.0.2.1/pre-migration.py b/openupgrade_scripts/scripts/l10n_fr/19.0.2.1/pre-migration.py new file mode 100644 index 000000000000..f3f69668f9a5 --- /dev/null +++ b/openupgrade_scripts/scripts/l10n_fr/19.0.2.1/pre-migration.py @@ -0,0 +1,19 @@ +# Copyright 2026 Tecnativa - Pilar Vargas +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from openupgradelib import openupgrade + + +@openupgrade.migrate() +def migrate(env, version): + # Migrate SIRET values to company_registry without overwriting existing data. + openupgrade.logged_query( + env.cr, + """ + UPDATE res_partner + SET company_registry = siret + WHERE siret IS NOT NULL + AND siret != '' + AND (company_registry IS NULL OR company_registry = '') + """, + ) diff --git a/openupgrade_scripts/scripts/l10n_fr/19.0.2.1/upgrade_analysis_work.txt b/openupgrade_scripts/scripts/l10n_fr/19.0.2.1/upgrade_analysis_work.txt new file mode 100644 index 000000000000..bf0f8023e9bd --- /dev/null +++ b/openupgrade_scripts/scripts/l10n_fr/19.0.2.1/upgrade_analysis_work.txt @@ -0,0 +1,13 @@ +---Models in module 'l10n_fr'--- +# NOTHING TO DO + +---Fields in module 'l10n_fr'--- +l10n_fr / res.partner / siret (char) : DEL +# DONE: pre-migration script migrated siret values to existing company_registry when empty. + +---XML records in module 'l10n_fr'--- +NEW ir.ui.view: l10n_fr.view_partner_form_inherit_l10n_fr +DEL ir.ui.view: l10n_fr.res_partner_form_l10n_fr +res.country.group: l10n_fr.fr_and_mc (noupdate) (noupdate switched) +DEL res.country.group: l10n_fr.dom-tom [renamed to base module] +# NOTHING TO DO diff --git a/openupgrade_scripts/scripts/l10n_fr_account/19.0.2.4/upgrade_analysis.txt b/openupgrade_scripts/scripts/l10n_fr_account/19.0.2.4/upgrade_analysis.txt index 934aa8b552e1..a30688d7ffb5 100644 --- a/openupgrade_scripts/scripts/l10n_fr_account/19.0.2.4/upgrade_analysis.txt +++ b/openupgrade_scripts/scripts/l10n_fr_account/19.0.2.4/upgrade_analysis.txt @@ -1,5 +1,9 @@ ---Models in module 'l10n_fr_account'--- +# NOTHING TO DO + ---Fields in module 'l10n_fr_account'--- +# NOTHING TO DO + ---XML records in module 'l10n_fr_account'--- NEW account.report.expression: l10n_fr_account.tax_report_08_base_balance_from_tags_purchase NEW account.report.expression: l10n_fr_account.tax_report_09_base_balance_from_tags_purchase @@ -7,3 +11,4 @@ NEW account.report.expression: l10n_fr_account.tax_report_10_base_balance_from_t NEW account.report.expression: l10n_fr_account.tax_report_11_base_balance_from_tags_purchase NEW account.report.expression: l10n_fr_account.tax_report_9B_base_balance_from_tags_purchase DEL ir.ui.view: l10n_fr_account.res_partner_form_l10n_fr +# NOTHING TO DO diff --git a/openupgrade_scripts/scripts/mail_bot_hr/19.0.1.0/upgrade_analysis_work.txt b/openupgrade_scripts/scripts/mail_bot_hr/19.0.1.0/upgrade_analysis_work.txt new file mode 100644 index 000000000000..56c991eb6279 --- /dev/null +++ b/openupgrade_scripts/scripts/mail_bot_hr/19.0.1.0/upgrade_analysis_work.txt @@ -0,0 +1,9 @@ +---Models in module 'mail_bot_hr'--- +# NOTHING TO DO + +---Fields in module 'mail_bot_hr'--- +# NOTHING TO DO + +---XML records in module 'mail_bot_hr'--- +DEL ir.ui.view: mail_bot_hr.res_users_view_form_profile +# NOTHING TO DO: removed inherited user profile view only diff --git a/openupgrade_scripts/scripts/maintenance/19.0.1.0/post-migration.py b/openupgrade_scripts/scripts/maintenance/19.0.1.0/post-migration.py new file mode 100644 index 000000000000..9613f8fc252a --- /dev/null +++ b/openupgrade_scripts/scripts/maintenance/19.0.1.0/post-migration.py @@ -0,0 +1,17 @@ +# Copyright 2026 Tecnativa - Carlos Lopez +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from openupgradelib import openupgrade + + +@openupgrade.migrate() +def migrate(env, version): + openupgrade.load_data(env, "maintenance", "19.0.1.0/noupdate_changes.xml") + openupgrade.delete_record_translations( + env.cr, + "maintenance", + ["mail_act_maintenance_request"], + ["summary"], + ) + model_id = env["ir.model"]._get_id("maintenance.equipment.category") + env["mail.alias"].search([("alias_parent_model_id", "=", model_id)]).unlink() diff --git a/openupgrade_scripts/scripts/maintenance/19.0.1.0/pre-migration.py b/openupgrade_scripts/scripts/maintenance/19.0.1.0/pre-migration.py new file mode 100644 index 000000000000..60420c200e31 --- /dev/null +++ b/openupgrade_scripts/scripts/maintenance/19.0.1.0/pre-migration.py @@ -0,0 +1,49 @@ +# Copyright 2026 Tecnativa - Carlos Lopez +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from openupgradelib import openupgrade + +_added_fields = [ + ( + "schedule_end", + "maintenance.request", + "maintenance_request", + "datetime", + None, + "maintenance", + ) +] + + +def fill_maintenance_request_schedule_end(env): + """ + Fill the schedule_end field in maintenance.request records + based on schedule_date and duration. + If duration is not set, default to 1 hour. + """ + openupgrade.logged_query( + env.cr, + """ + UPDATE maintenance_request mr + SET schedule_end = schedule_date + INTERVAL '1 hour' * ( + CASE + WHEN mr.duration = 0 THEN 1 + ELSE COALESCE(mr.duration, 1) + END + ) + WHERE mr.schedule_date IS NOT NULL + """, + ) + + +@openupgrade.migrate() +def migrate(env, version): + openupgrade.add_fields(env, _added_fields) + fill_maintenance_request_schedule_end(env) + openupgrade.logged_query( + env.cr, + """ + ALTER TABLE maintenance_equipment_category + DROP CONSTRAINT IF EXISTS maintenance_equipment_category_alias_id_fkey; + """, + ) diff --git a/openupgrade_scripts/scripts/maintenance/19.0.1.0/upgrade_analysis_work.txt b/openupgrade_scripts/scripts/maintenance/19.0.1.0/upgrade_analysis_work.txt new file mode 100644 index 000000000000..47ebae4a31c3 --- /dev/null +++ b/openupgrade_scripts/scripts/maintenance/19.0.1.0/upgrade_analysis_work.txt @@ -0,0 +1,33 @@ +---Models in module 'maintenance'--- +---Fields in module 'maintenance'--- +maintenance / maintenance.equipment / location (char) : DEL +# NOTHING TO DO: Odoo converts this field from char to many2one in the new stock_maintenance module. +# However, before this change, the location field was only informational, so we did not recreate it as a stock.location records. +# see https://github.com/odoo/odoo/pull/186032 + +maintenance / maintenance.equipment / match_serial (boolean) : module is now 'stock_maintenance' ('maintenance') +# NOTHING TO DO: It was simply moved to the stock_maintenance module. + +maintenance / maintenance.equipment.category / alias_id (many2one) : DEL relation: mail.alias, required +maintenance / maintenance.equipment.category / _inherits : DEL _inherits: {'mail.alias': 'alias_id'}, stored: False +maintenance / maintenance.equipment.category / message_follower_ids (one2many): DEL relation: mail.followers +maintenance / maintenance.equipment.category / message_ids (one2many) : DEL relation: mail.message +# DONE: post-migration, delete the mail.alias records related to maintenance.equipment.category + +maintenance / maintenance.team / _inherits : NEW _inherits: {'mail.alias': 'alias_id'}, stored: False +maintenance / maintenance.team / alias_id (many2one) : NEW relation: mail.alias, required +maintenance / maintenance.team / message_follower_ids (one2many): NEW relation: mail.followers +maintenance / maintenance.team / message_ids (one2many) : NEW relation: mail.message +# NOTHING TO DO: There are no direct relationships that allow translating data from maintenance.equipment.category to maintenance.team. +# See https://github.com/odoo/odoo/pull/196181 + +maintenance / maintenance.request / duration (float) : now a function +# NOTHING TO DO: The field is now computed, but the underlying logic remains the same. The existing data is preserved. + +maintenance / maintenance.request / schedule_end (datetime) : NEW hasdefault: compute +# DONE: pre-migration precreated and populated based on schedule_date and duration when duration was set. +# Otherwise, one hour was added to schedule_date, matching Odoo's field computation logic. + +---XML records in module 'maintenance'--- +NEW res.groups.privilege: maintenance.res_groups_privilege_maintenance +# NOTHING TO DO: New feature diff --git a/openupgrade_scripts/scripts/microsoft_outlook/19.0.1.1/upgrade_analysis_work.txt b/openupgrade_scripts/scripts/microsoft_outlook/19.0.1.1/upgrade_analysis_work.txt new file mode 100644 index 000000000000..932d483cb709 --- /dev/null +++ b/openupgrade_scripts/scripts/microsoft_outlook/19.0.1.1/upgrade_analysis_work.txt @@ -0,0 +1,9 @@ +---Models in module 'microsoft_outlook'--- +# NOTHING TO DO + +---Fields in module 'microsoft_outlook'--- +microsoft_outlook / res.users / outgoing_mail_server_type (False): NEW selection_keys: ['default', 'gmail', 'outlook'], mode: modify +# NOTHING TO DO: module only adds the new 'outlook' selection value + +---XML records in module 'microsoft_outlook'--- +# NOTHING TO DO diff --git a/openupgrade_scripts/scripts/payment_stripe/19.0.2.0/upgrade_analysis_work.txt b/openupgrade_scripts/scripts/payment_stripe/19.0.2.0/upgrade_analysis_work.txt new file mode 100644 index 000000000000..6569c8ce69a1 --- /dev/null +++ b/openupgrade_scripts/scripts/payment_stripe/19.0.2.0/upgrade_analysis_work.txt @@ -0,0 +1,9 @@ +---Models in module 'payment_stripe'--- +# NOTHING TO DO + +---Fields in module 'payment_stripe'--- +payment_stripe / payment.provider / code (False) : selection_keys added: [dpo, ecpay, iyzico, paymob, redsys] (most likely nothing to do) +# NOTHING TO DO: added provider codes in shared selection field, no Stripe data migration needed + +---XML records in module 'payment_stripe'--- +# NOTHING TO DO diff --git a/openupgrade_scripts/scripts/sale_crm/19.0.1.0/upgrade_analysis work.txt b/openupgrade_scripts/scripts/sale_crm/19.0.1.0/upgrade_analysis work.txt new file mode 100644 index 000000000000..143eeb42e26e --- /dev/null +++ b/openupgrade_scripts/scripts/sale_crm/19.0.1.0/upgrade_analysis work.txt @@ -0,0 +1,8 @@ +---Models in module 'sale_crm'--- +---Fields in module 'sale_crm'--- +sale_crm / res.users / target_sales_invoiced (integer): DEL +# NOTHING TO DO: functionality removed, no replacement found. + +---XML records in module 'sale_crm'--- +DEL ir.ui.view: sale_crm.res_partner_address_type +# NOTHING TO DO diff --git a/openupgrade_scripts/scripts/sale_expense/19.0.1.0/post-migration.py b/openupgrade_scripts/scripts/sale_expense/19.0.1.0/post-migration.py new file mode 100644 index 000000000000..564d6f38793f --- /dev/null +++ b/openupgrade_scripts/scripts/sale_expense/19.0.1.0/post-migration.py @@ -0,0 +1,39 @@ +# Copyright 2026 Tecnativa - Carlos Lopez +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from openupgradelib import openupgrade + + +def fill_hr_expense_sale_order_line_id(env): + """ + This function finds the corresponding sale order line for each hr.expense record + based on the product, quantity, and expense name + A sale order can have multiple lines with the same product and quantity, + so we use DISTINCT ON to select the first matching sale order line + """ + env.cr.execute( + """ + WITH expense_sale_line_match AS ( + SELECT DISTINCT ON (he.id) + he.id AS expense_id, + sol.id AS sale_line_id + FROM hr_expense he + JOIN account_move_line aml ON aml.expense_id = he.id + JOIN sale_order_line sol ON sol.name = aml.name + JOIN sale_order so ON so.id = sol.order_id AND so.id = he.sale_order_id + WHERE sol.product_id = he.product_id + AND sol.product_uom_qty = he.quantity + AND sol.is_expense = True + ORDER BY he.id, sol.id + ) + UPDATE hr_expense he + SET sale_order_line_id = esm.sale_line_id + FROM expense_sale_line_match esm + WHERE esm.expense_id = he.id + """ + ) + + +@openupgrade.migrate() +def migrate(env, version): + fill_hr_expense_sale_order_line_id(env) diff --git a/openupgrade_scripts/scripts/sale_expense/19.0.1.0/pre-migration.py b/openupgrade_scripts/scripts/sale_expense/19.0.1.0/pre-migration.py new file mode 100644 index 000000000000..be171258db2c --- /dev/null +++ b/openupgrade_scripts/scripts/sale_expense/19.0.1.0/pre-migration.py @@ -0,0 +1,13 @@ +# Copyright 2026 Tecnativa - Carlos Lopez +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from openupgradelib import openupgrade + +_added_fields = [ + ("sale_order_line_id", "hr.expense", "hr_expense", "many2one", None, "sale_expense") +] + + +@openupgrade.migrate() +def migrate(env, version): + openupgrade.add_fields(env, _added_fields) diff --git a/openupgrade_scripts/scripts/sale_expense/19.0.1.0/upgrade_analysis_work.txt b/openupgrade_scripts/scripts/sale_expense/19.0.1.0/upgrade_analysis_work.txt new file mode 100644 index 000000000000..70debba5f6fc --- /dev/null +++ b/openupgrade_scripts/scripts/sale_expense/19.0.1.0/upgrade_analysis_work.txt @@ -0,0 +1,13 @@ +---Models in module 'sale_expense'--- +---Fields in module 'sale_expense'--- +sale_expense / hr.expense / sale_order_line_id (many2one) : NEW relation: sale.order.line, isfunction: function, stored +sale_expense / sale.order.line / expense_ids (one2many) : NEW relation: hr.expense +# DONE: precreated in pre-migration and populated in post-migration using a heuristic based on sale_order_id, name, product_id, and quantity. + +---XML records in module 'sale_expense'--- +NEW ir.ui.view: sale_expense.sale_order_reinvoice_tree_view +# NOTHING TO DO: Handled by the ORM. A new view was inherited from the primary view to add groups to some fields. + +DEL ir.ui.view: sale_expense.hr_expense_sheet_form_view_inherit_sale_expense +DEL ir.ui.view: sale_expense.hr_expense_sheet_view_form +# NOTHING TO DO: Handled by the ORM. The views were removed because the hr.expense.sheet model was removed. diff --git a/openupgrade_scripts/scripts/stock_maintenance/19.0.1.0/upgrade_analysis_work.txt b/openupgrade_scripts/scripts/stock_maintenance/19.0.1.0/upgrade_analysis_work.txt new file mode 100644 index 000000000000..f08dd242cdde --- /dev/null +++ b/openupgrade_scripts/scripts/stock_maintenance/19.0.1.0/upgrade_analysis_work.txt @@ -0,0 +1,12 @@ +---Models in module 'stock_maintenance'--- +---Fields in module 'stock_maintenance'--- +stock_maintenance / maintenance.equipment / location_id (many2one) : NEW relation: stock.location +# NOTHING TO DO: New feature + +stock_maintenance / maintenance.equipment / match_serial (boolean) : previously in module maintenance +# NOTHING TO DO: It was simply moved to the maintenance module. + +---XML records in module 'stock_maintenance'--- +NEW ir.ui.view: stock_maintenance.maintenance_stock_equipment_view_form +NEW ir.ui.view: stock_maintenance.stock_location_form_maintenance_equipments +# NOTHING TO DO: Handled by ORM diff --git a/openupgrade_scripts/scripts/stock_picking_batch/19.0.1.0/upgrade_analysis_work.txt b/openupgrade_scripts/scripts/stock_picking_batch/19.0.1.0/upgrade_analysis_work.txt new file mode 100644 index 000000000000..70864b2d6a92 --- /dev/null +++ b/openupgrade_scripts/scripts/stock_picking_batch/19.0.1.0/upgrade_analysis_work.txt @@ -0,0 +1,8 @@ +---Models in module 'stock_picking_batch'--- +---Fields in module 'stock_picking_batch'--- +stock_picking_batch / stock.move.line / batch_id (many2one) : not stored anymore +# NOTHING TO DO: Handled by ORM + +---XML records in module 'stock_picking_batch'--- +NEW ir.actions.server: stock_picking_batch.action_merge_batch_picking +# NOTHING TO DO: New feature added in https://github.com/odoo/odoo/pull/210624 diff --git a/openupgrade_scripts/scripts/survey/19.0.3.7/post-migration.py b/openupgrade_scripts/scripts/survey/19.0.3.7/post-migration.py new file mode 100644 index 000000000000..7a6e4fb3c84e --- /dev/null +++ b/openupgrade_scripts/scripts/survey/19.0.3.7/post-migration.py @@ -0,0 +1,19 @@ +# Copyright 2026 Tecnativa - Carlos Lopez +# Copyright 2026 Tecnativa - Eduardo Ezerouali +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + + +from openupgradelib import openupgrade + + +def _empty_lang_ids(env): + openupgrade.logged_query( + env.cr, + "DELETE FROM res_lang_survey_survey_rel", + ) + + +@openupgrade.migrate() +def migrate(env, version): + openupgrade.load_data(env, "survey", "19.0.3.7/noupdate_changes.xml") + _empty_lang_ids(env) diff --git a/openupgrade_scripts/scripts/survey/19.0.3.7/upgrade_analysis_work.txt b/openupgrade_scripts/scripts/survey/19.0.3.7/upgrade_analysis_work.txt new file mode 100644 index 000000000000..773e491bf926 --- /dev/null +++ b/openupgrade_scripts/scripts/survey/19.0.3.7/upgrade_analysis_work.txt @@ -0,0 +1,16 @@ +---Models in module 'survey'--- +---Fields in module 'survey'--- +survey / survey.survey / lang_ids (many2many) : NEW relation: res.lang, hasdefault: default +# DONE: post-migration: clear lang_ids so each survey falls back to all installed languages instead of default that set first installed language found. +# This feature was introduced in https://github.com/odoo/odoo/pull/165760 + +survey / survey.user_input / lang_id (many2one) : NEW relation: res.lang +# NOTHING TO DO + +survey / survey.user_input.line / answer_is_correct (boolean) : now a function +survey / survey.user_input.line / answer_score (float) : now a function +# NOTHING TO DO: The fields already exist, and the computation logic remains the same. + +---XML records in module 'survey'--- +NEW res.groups.privilege: survey.res_groups_privilege_surveys (noupdate) +# NOTHING TO DO: Handled by ORM diff --git a/openupgrade_scripts/scripts/website_blog/19.0.1.1/post-migration.py b/openupgrade_scripts/scripts/website_blog/19.0.1.1/post-migration.py new file mode 100644 index 000000000000..5e80aa0f84fa --- /dev/null +++ b/openupgrade_scripts/scripts/website_blog/19.0.1.1/post-migration.py @@ -0,0 +1,15 @@ +# Copyright 2026 Tecnativa - Carlos Lopez +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from openupgradelib import openupgrade + + +@openupgrade.migrate() +def migrate(env, version): + openupgrade.load_data(env, "website_blog", "19.0.1.1/noupdate_changes.xml") + openupgrade.delete_record_translations( + env.cr, + "website_blog", + ["blog_post_template_new_post"], + ["arch_db"], + ) diff --git a/openupgrade_scripts/scripts/website_blog/19.0.1.1/pre-migration.py b/openupgrade_scripts/scripts/website_blog/19.0.1.1/pre-migration.py new file mode 100644 index 000000000000..dd7f2cdd4cc3 --- /dev/null +++ b/openupgrade_scripts/scripts/website_blog/19.0.1.1/pre-migration.py @@ -0,0 +1,68 @@ +# Copyright 2026 Tecnativa - Carlos Lopez +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from openupgradelib import openupgrade + +_new_columns = [ + ("blog.blog", "sequence", "integer", None, "blog_blog"), + ("blog.blog", "is_seo_optimized", "boolean", False, "blog_blog"), + ("blog.post", "is_seo_optimized", "boolean", False, "blog_post"), + ("blog.tag", "is_seo_optimized", "boolean", False, "blog_tag"), +] + + +def _fill_blog_is_seo_optimized(env): + openupgrade.logged_query( + env.cr, + """ + UPDATE blog_blog + SET is_seo_optimized = True + WHERE website_meta_title IS NOT NULL + AND website_meta_description IS NOT NULL + AND website_meta_keywords IS NOT NULL + """, + ) + openupgrade.logged_query( + env.cr, + """ + UPDATE blog_post + SET is_seo_optimized = True + WHERE website_meta_title IS NOT NULL + AND website_meta_description IS NOT NULL + AND website_meta_keywords IS NOT NULL + """, + ) + openupgrade.logged_query( + env.cr, + """ + UPDATE blog_tag + SET is_seo_optimized = True + WHERE website_meta_title IS NOT NULL + AND website_meta_description IS NOT NULL + AND website_meta_keywords IS NOT NULL + """, + ) + + +def _fill_blog_blog_sequence(env): + openupgrade.logged_query( + env.cr, + """ + UPDATE blog_blog AS bb + SET sequence = sequence_data.sequence + FROM ( + SELECT + id, + row_number() OVER (ORDER BY create_date ASC, id ASC) AS sequence + FROM blog_blog + ) AS sequence_data + WHERE bb.id = sequence_data.id + """, + ) + + +@openupgrade.migrate() +def migrate(env, version): + openupgrade.add_columns(env, _new_columns) + _fill_blog_is_seo_optimized(env) + _fill_blog_blog_sequence(env) diff --git a/openupgrade_scripts/scripts/website_blog/19.0.1.1/upgrade_analysis_work.txt b/openupgrade_scripts/scripts/website_blog/19.0.1.1/upgrade_analysis_work.txt new file mode 100644 index 000000000000..10fac904b03c --- /dev/null +++ b/openupgrade_scripts/scripts/website_blog/19.0.1.1/upgrade_analysis_work.txt @@ -0,0 +1,48 @@ +---Models in module 'website_blog'--- +---Fields in module 'website_blog'--- +website_blog / blog.blog / is_seo_optimized (boolean) : is now stored +website_blog / blog.post / is_seo_optimized (boolean) : is now stored +website_blog / blog.tag / is_seo_optimized (boolean) : is now stored +# DONE: pre-migration: Pre-created and populated these fields. + +website_blog / blog.blog / sequence (integer) : NEW hasdefault: default +# DONE: pre-migration: Pre-created and populated this field to preserve the old order ORDER BY create_date ASC, id ASC. + +website_blog / blog.post / footer_visible (boolean) : NEW hasdefault: default +website_blog / blog.post / header_visible (boolean) : NEW hasdefault: default +# NOTHING TO DO: The fields are created by inheriting website.page_visibility_options.mixin. + +---XML records in module 'website_blog'--- +NEW ir.ui.view: website_blog.blog_post_info +NEW ir.ui.view: website_blog.dynamic_filter_template_blog_post_single_aside +NEW ir.ui.view: website_blog.dynamic_filter_template_blog_post_single_badge +NEW ir.ui.view: website_blog.dynamic_filter_template_blog_post_single_circle +NEW ir.ui.view: website_blog.dynamic_filter_template_blog_post_single_full +NEW ir.ui.view: website_blog.s_blog_posts_big_picture +NEW ir.ui.view: website_blog.s_blog_posts_card +NEW ir.ui.view: website_blog.s_blog_posts_horizontal +NEW ir.ui.view: website_blog.s_blog_posts_list +NEW ir.ui.view: website_blog.s_blog_posts_single_aside +NEW ir.ui.view: website_blog.s_blog_posts_single_badge +NEW ir.ui.view: website_blog.s_blog_posts_single_circle +NEW ir.ui.view: website_blog.s_blog_posts_single_full +NEW ir.ui.view: website_blog.s_dynamic_snippet_blog_posts_card_preview_data +NEW ir.ui.view: website_blog.s_dynamic_snippet_blog_posts_horizontal_preview_data +NEW ir.ui.view: website_blog.s_dynamic_snippet_blog_posts_list_preview_data +NEW ir.ui.view: website_blog.s_dynamic_snippet_blog_posts_single_aside_preview_data +NEW ir.ui.view: website_blog.s_dynamic_snippet_blog_posts_single_badge_preview_data +NEW ir.ui.view: website_blog.s_dynamic_snippet_blog_posts_single_circle_preview_data +NEW ir.ui.view: website_blog.s_dynamic_snippet_blog_posts_single_full_preview_data +NEW ir.ui.view: website_blog.s_dynamic_snippet_template_category +# NOTHING TO DO: New feature + +DEL ir.ui.view: website_blog.opt_blog_post_select_to_comment +DEL ir.ui.view: website_blog.opt_blog_post_select_to_tweet +# NOTHING TO DO: Odoo removed this in https://github.com/odoo/odoo/pull/178568 + +DEL ir.ui.view: website_blog.blog_searchbar_input_snippet_options +DEL ir.ui.view: website_blog.s_blog_posts_options +DEL ir.ui.view: website_blog.s_dynamic_snippet_options_template +DEL ir.ui.view: website_blog.snippet_options +DEL ir.asset: website_blog.s_blog_posts_000_js +# NOTHING TO DO: Handled by ORM diff --git a/openupgrade_scripts/scripts/website_hr_recruitment/19.0.1.1/pre-migration.py b/openupgrade_scripts/scripts/website_hr_recruitment/19.0.1.1/pre-migration.py new file mode 100644 index 000000000000..ad8311a1593e --- /dev/null +++ b/openupgrade_scripts/scripts/website_hr_recruitment/19.0.1.1/pre-migration.py @@ -0,0 +1,25 @@ +# Copyright 2026 Tecnativa - Carlos Lopez +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from openupgradelib import openupgrade + + +def _precreate_hr_job_is_seo_optimized(env): + openupgrade.add_columns( + env, [("hr.job", "is_seo_optimized", "boolean", False, "hr_job")] + ) + openupgrade.logged_query( + env.cr, + """ + UPDATE hr_job + SET is_seo_optimized = True + WHERE website_meta_title IS NOT NULL + AND website_meta_description IS NOT NULL + AND website_meta_keywords IS NOT NULL + """, + ) + + +@openupgrade.migrate() +def migrate(env, version): + _precreate_hr_job_is_seo_optimized(env) diff --git a/openupgrade_scripts/scripts/website_hr_recruitment/19.0.1.1/upgrade_analysis_work.txt b/openupgrade_scripts/scripts/website_hr_recruitment/19.0.1.1/upgrade_analysis_work.txt new file mode 100644 index 000000000000..435d855723ae --- /dev/null +++ b/openupgrade_scripts/scripts/website_hr_recruitment/19.0.1.1/upgrade_analysis_work.txt @@ -0,0 +1,13 @@ +---Models in module 'website_hr_recruitment'--- +---Fields in module 'website_hr_recruitment'--- +website_hr_recruitment / hr.job / is_seo_optimized (boolean) : is now stored +# DONE: pre-migration: Pre-created and fill + +---XML records in module 'website_hr_recruitment'--- +NEW ir.ui.view: website_hr_recruitment.job_filter_base +NEW ir.ui.view: website_hr_recruitment.job_filter_base_mobile +NEW ir.ui.view: website_hr_recruitment.job_filter_by_industries +NEW ir.ui.view: website_hr_recruitment.job_reset_filters +DEL ir.ui.view: website_hr_recruitment.jobs_searchbar_input_snippet_options +DEL ir.ui.view: website_hr_recruitment.snippet_options +# NOTHING TO DO: Handled by ORM diff --git a/openupgrade_scripts/scripts/website_profile/19.0.1.0/post-migration.py b/openupgrade_scripts/scripts/website_profile/19.0.1.0/post-migration.py new file mode 100644 index 000000000000..41c2ee89cc5d --- /dev/null +++ b/openupgrade_scripts/scripts/website_profile/19.0.1.0/post-migration.py @@ -0,0 +1,15 @@ +# Copyright 2026 Tecnativa - Pilar Vargas +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from openupgradelib import openupgrade + + +@openupgrade.migrate() +def migrate(env, version): + openupgrade.load_data(env, "website_profile", "19.0.1.0/noupdate_changes.xml") + openupgrade.delete_record_translations( + env.cr, + "website_profile", + ["validation_email"], + ["body_html"], + ) diff --git a/openupgrade_scripts/scripts/website_profile/19.0.1.0/upgrade_analysis_work.txt b/openupgrade_scripts/scripts/website_profile/19.0.1.0/upgrade_analysis_work.txt new file mode 100644 index 000000000000..f012da0fc593 --- /dev/null +++ b/openupgrade_scripts/scripts/website_profile/19.0.1.0/upgrade_analysis_work.txt @@ -0,0 +1,7 @@ +---Models in module 'website_profile'--- +---Fields in module 'website_profile'--- +---XML records in module 'website_profile'--- +DEL ir.ui.view: website_profile.user_biography_editor +DEL ir.ui.view: website_profile.user_profile_edit_content +DEL ir.ui.view: website_profile.user_profile_edit_main +# NOTHING TO DO diff --git a/openupgrade_scripts/scripts/website_project/19.0.1.0/upgrade_analysis_work.txt b/openupgrade_scripts/scripts/website_project/19.0.1.0/upgrade_analysis_work.txt new file mode 100644 index 000000000000..633ba9447d03 --- /dev/null +++ b/openupgrade_scripts/scripts/website_project/19.0.1.0/upgrade_analysis_work.txt @@ -0,0 +1,9 @@ +---Models in module 'website_project'--- +---Fields in module 'website_project'--- +website_project / project.task / email_from (char) : module is now 'project' ('website_project') +# NOTHING TO DO: It was simply moved to project in https://github.com/odoo/odoo/pull/194699 + +website_project / project.task / partner_phone (char) : module is now 'project' ('website_project') +# NOTHING TO DO: It was simply moved to project in https://github.com/odoo/odoo/pull/188581 + +---XML records in module 'website_project'---