Skip to content

[19.0][MIG] ai_connection: Migration to 19.0 - #111

Open
volkantasci wants to merge 7 commits into
OCA:19.0from
volkantasci:19.0-mig-ai_connection
Open

volkantasci wants to merge 7 commits into
OCA:19.0from
volkantasci:19.0-mig-ai_connection

Conversation

@volkantasci

Copy link
Copy Markdown

Migration of ai_connection to 19.0, following the OCA migration guidelines:

  • Full module history replayed from 18.0 (git format-patch ... | git am -3 --keep), so original authors, Weblate translations and bot commits are preserved.
  • Single [MIG] commit on top carrying the actual 19.0 adaptation:
    • version bump to 19.0.1.0.0
    • test fakes migrated from odoo_test_helper.FakeModelLoader to the native add_to_registry API
  • Branch is stacked on [19.0][MIG] ai_tool: Migration to 19.0 #110 (ai_tool migration) so CI can resolve the dependency; once [19.0][MIG] ai_tool: Migration to 19.0 #110 merges I will rebase this branch onto 19.0 to drop the duplicated commits.

This PR replaces the ai_connection part of #100 (restructured per the review that the migration was not following OCA guidelines). The final tree is byte-identical to the content that passed CI there.

Per the migration guideline task 'Add tests to increase code coverage':
- base AiConnectionClient.handle_message raises NotImplementedError
- _run with a system_prompt prepends it to the messages
- a failing tool call goes through the tool-call error handling
@volkantasci

Copy link
Copy Markdown
Author

Hi @pedrobaeza 👋 — this ai_connection 19.0 migration is ready for review whenever you have a moment: all checks are green (pre-commit, codecov, runboat, Odoo/OCB tests, CLA). It is also the dependency for #96 (ai_document_extraction), so merging it would unblock that PR as well. Thanks for the help!

@pedrobaeza

Copy link
Copy Markdown
Member

@etobella and @angelmoya should review

/ocabot migration ai_connection

@OCA-git-bot OCA-git-bot added this to the 19.0 milestone Sep 5, 2026
@OCA-git-bot OCA-git-bot mentioned this pull request Sep 5, 2026
6 tasks
@volkantasci

Copy link
Copy Markdown
Author

Hi @etobella, @angelmoya 👋

Gentle follow-up on this ai_connection 19.0 migration (10 days since @pedrobaeza routed it here). Current state:

  • All checks green: pre-commit, Odoo/OCB tests, codecov (patch + project), runboat, CLA — and it is MERGEABLE.
  • Follows the OCA migration guidelines: the module's full 18.0 history is replayed and the whole 19.0 adaptation sits in a single [MIG] ai_connection: Migration to 19.0 commit, plus tests added for the previously uncovered paths (99% coverage).

It is the last missing dependency for two other PRs: #96 (ai_document_extraction) and #106 (ai_sale_product_matcher). Both currently fail only because odoo-addon-ai_connection==19.0.* is not yet on the wheelhouse — merging this publishes the wheel and unblocks them.

Happy to adjust anything. Thanks for your time!

from odoo.orm.model_classes import add_to_registry
from odoo.tests.common import TransactionCase

from .fake_models import AiConnection

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Fake models should be added in the init.

super().setUpClass()
add_to_registry(cls.registry, AiConnection)
cls.registry._setup_models__(cls.env.cr, [AiConnection._name])
cls.registry.init_models(cls.env.cr, [AiConnection._name], {})

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants