Skip to content

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

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

volkantasci wants to merge 6 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.

@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
1 of 8 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.

Comment thread ai_connection/tests/test_connection.py Outdated
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.

@volkantasci

Copy link
Copy Markdown
Author

Thanks @etobella — both review points are addressed in d3d5238:

  • init_models now runs with {"models_to_check": True} per the 19.0 migration guide
  • added cls.addClassCleanup(cls.registry.__delitem__, AiConnection._name) to clean up the fake model after the test run

Could you take another look when you have a moment? This one is also the dependency for #96 and #106.

@etobella

etobella commented Oct 7, 2026

Copy link
Copy Markdown
Member

Can you squash your commits please?

@volkantasci
volkantasci force-pushed the 19.0-mig-ai_connection branch from d3d5238 to aaf6bbd Compare October 7, 2026 08:37
@volkantasci

Copy link
Copy Markdown
Author

Done — squashed into a single [MIG] ai_connection: Migration to 19.0 commit (aaf6bbd), the tree is unchanged. The checks are re-running now. Thanks for the review!

@volkantasci

Copy link
Copy Markdown
Author

Hi @etobella 👋 — gentle reminder on this one: as requested, the commits are squashed into a single [MIG] ai_connection: Migration to 19.0 commit (aaf6bbd), all checks are green and the branch is up to date with 19.0. It is also the last remaining blocker for #96 and #106. Could you take another look when you have a moment? Thanks in advance!

@etobella

Copy link
Copy Markdown
Member

@volkantasci you squashed all commits, you should squash only your commits 😞

@volkantasci
volkantasci force-pushed the 19.0-mig-ai_connection branch from aaf6bbd to 30f2a17 Compare October 15, 2026 16:45
@volkantasci

Copy link
Copy Markdown
Author

Ah, my apologies @etobella — that was my mistake: I squashed everything. It's fixed now: the original commits are restored as they were, and only my own commits are squashed into a single [MIG] ai_connection: Migration to 19.0 commit (30f2a17). The tree is unchanged, and the checks are re-running. Sorry for the noise, and thanks for the careful review!

Comment thread ai_connection/tests/fake_models.py Outdated

class AiConnection(models.Model):
_inherit = "ai.connection"
_name = "ai.connection"

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.

the inherit was enough isn't it?

Why did you apply this?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

You are right, @etobella — it was redundant: in Odoo 19 the metaclass derives _name from a string _inherit, so _inherit = "ai.connection" alone is enough. Removed it in 6f73b4e, so the definition is back to the original form. Thanks for the catch!

@volkantasci
volkantasci force-pushed the 19.0-mig-ai_connection branch from 30f2a17 to 6f73b4e Compare October 21, 2026 11:39
@volkantasci

Copy link
Copy Markdown
Author

Thank you for the review and approval, @etobella! 🙏 Please let me know if anything else is needed from my side. This also unblocks #96 and #106 — we'll re-run their tests as soon as it lands.

@volkantasci
volkantasci force-pushed the 19.0-mig-ai_connection branch from 6f73b4e to 4cb84ad Compare October 26, 2026 13:13
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