Skip to content
Merged
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
22 changes: 22 additions & 0 deletions endpoint/migrations/18.0.1.0.0/post-migrate.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright 2025 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)

import logging

from odoo import SUPERUSER_ID, api

_logger = logging.getLogger(__name__)


def migrate(cr, version):
"""Force update endpoint_route table.

New params like `readonly` should be added to the stored routes.
"""
if not version:
return
env = api.Environment(cr, SUPERUSER_ID, {})
model = env["endpoint.endpoint"]
records = model.sudo().search([])
records._handle_registry_sync()
_logger.info("Forced endpoint route sync on %s records", model._name)