Skip to content

[ADD] ai_oca_bridge#2

Merged
OCA-git-bot merged 1 commit intoOCA:16.0from
dixmit:16.0-add-bridge
Jun 9, 2025
Merged

[ADD] ai_oca_bridge#2
OCA-git-bot merged 1 commit intoOCA:16.0from
dixmit:16.0-add-bridge

Conversation

@etobella
Copy link
Member

@etobella etobella commented Jun 7, 2025

This module is used to create a bridge between Odoo and other AI systems
like n8n.

Define a bridge and it will be shown automatically in the chatter of the model.

TODO:

  • Finish Documentation
  • Add tests for JS
  • Add tests for Python
  • Forward port to 17-18
output.mp4

This example only shows the communication. We could do a lot of things from this point.

The only limit is our imagination 😉

@ValentinVinagre

Copy link

@HaraldPanten HaraldPanten left a comment

Choose a reason for hiding this comment

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

You should change the name of the first commit.

ai_bridge instead of ia_bridge

@etobella etobella changed the title [ADD] ia_bridge [ADD] ai_bridge Jun 8, 2025
@etobella
Copy link
Member Author

etobella commented Jun 8, 2025

The module is working, and tests are there. I think this can opt as v1 of this module and then, we can start working from this module.

I am open to add new ideas to ROADMAP, but I would prefer to keep starting logic simple.

Copy link

@ValentinVinagre ValentinVinagre left a comment

Choose a reason for hiding this comment

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

small review 😄 , feel free to expand the roadmap.
It is currently not possible to install the module in 16CE.

Copy link

@ValentinVinagre ValentinVinagre left a comment

Choose a reason for hiding this comment

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

Some comments, In this version is complete functional 😄 great work 🚀 .
Tested with personal N8N.

@etobella etobella changed the title [ADD] ai_bridge [ADD] ai_oca_bridge Jun 9, 2025
@etobella etobella requested a review from HaraldPanten June 9, 2025 10:19
@etobella
Copy link
Member Author

etobella commented Jun 9, 2025

@HaraldPanten you asked for changes. Can you review?

Copy link
Member

@Abranes Abranes left a comment

Choose a reason for hiding this comment

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

Nice one!

Code and functional test on runboat.

Would it be interesting to display the launched executions and their status in the origin record?

Copy link

@ValentinVinagre ValentinVinagre left a comment

Choose a reason for hiding this comment

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

some comments.
Would you suggest showing the user a pop-up message in the top right confirming the action has been executed? Currently, there's no user notification, and that could lead to them clicking a lot.
@etobella @HaraldPanten

execution_count = fields.Integer(
compute="_compute_execution_count",
)
url = fields.Char(

Choose a reason for hiding this comment

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

How do you see adding a "connection" option? Currently, it could be indicated by URL, and if necessary, it could be expanded.
Although it could be done later.

Copy link

@ValentinVinagre ValentinVinagre left a comment

Choose a reason for hiding this comment

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

Functionally tested and, in my opinion, ready to be merged. Missing items include:

  • points in the header of PR.
  • adding a user notification option (same as calendar, etc.)
  • fixing the informational popup for user actions when the text is long (roadmap).

@etobella etobella force-pushed the 16.0-add-bridge branch 6 times, most recently from d6e6998 to 5c66d39 Compare June 9, 2025 17:59
Copy link

@ValentinVinagre ValentinVinagre left a comment

Choose a reason for hiding this comment

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

Final tests performed (All these tests have been performed with an N8N environment with different flows; Odoo CE multiusers and multicompany):

  • When archiving an ai.bridge, the user can continue using it until the user changes or refreshes the screen. Would it be necessary to check if it's archived before launching it? (I don't see this as necessary for this version.)
  • Same as above, but referring to user groups. If the configuration is changed, even the refresh or screen change doesn't apply. (I don't see this as necessary for this version.)
  • If the user doesn't have permissions to retrieve information from certain fields, a permissions error will occur. This shouldn't happen with proper permissions settings. However, would it be necessary to execute a sudo to extract data and avoid this potential problem? (A record is not created in the ai.bridge.execution model, so this is correct.) [Nothing can be done at this point.]
  • When testing a demo user, you must grant them "Administration/Access Rights." You should extract "id," "_model," and "_id" with sudo, as this is basic information. (This point needs to be addressed.)
  • Test with a demo user by adding the correct "Administration/Access Rights" permissions. Usability is working correctly.[Nothing can be done at this point.]
  • Correct ai.bridge sorting and filtering in the user widget. Across different users, permissions, and models.[Nothing can be done at this point.]
  • Connection tests with different correct authentications.[Nothing can be done at this point.]
  • The connection method change is automatically applied to users, everything is correct.[Nothing can be done at this point.]
  • If the user is in a multi-company and only has one active, everything works correctly.[Nothing can be done at this point.]
  • If the user is in multi-company mode and selects View +1 company, all ai.bridges are visible and executable. I believe only those from the active company (the one selected in the company change widget) should be displayed. Another option would be to display the company if it is configured in the ai.bridge configuration (e.g., company1 - magic1). This nomenclature could be a problem if the M2M company field is created in the ai.bridge model. [It can be added to the Roadmap; it is not considered urgent.]
  • Tests were performed with filtering by company and different executions. The ai.bridge.execution correctly records the execution company.[Nothing can be done at this point.]
  • The company from which the payload was executed isn't transferred. Would that be necessary? If it is added, it would be "user_company."[It can be added to the Roadmap]
  • Would it be necessary to be able to select N companies instead of 1 in the ai.bridge model? [It can be added to the Roadmap]
  • Usage field works correctly.[Nothing can be done at this point.]

@etobella
Copy link
Member Author

etobella commented Jun 9, 2025

Final tests performed (All these tests have been performed with an N8N environment with different flows; Odoo CE multiusers and multicompany):

  • When archiving an ai.bridge, the user can continue using it until the user changes or refreshes the screen. Would it be necessary to check if it's archived before launching it? (I don't see this as necessary for this version.)

Fixed

  • Same as above, but referring to user groups. If the configuration is changed, even the refresh or screen change doesn't apply. (I don't see this as necessary for this version.)

Fixed

  • If the user doesn't have permissions to retrieve information from certain fields, a permissions error will occur. This shouldn't happen with proper permissions settings. However, would it be necessary to execute a sudo to extract data and avoid this potential problem? (A record is not created in the ai.bridge.execution model, so this is correct.) [Nothing can be done at this point.]
  • When testing a demo user, you must grant them "Administration/Access Rights." You should extract "id," "_model," and "_id" with sudo, as this is basic information. (This point needs to be addressed.)

Fixed

  • Test with a demo user by adding the correct "Administration/Access Rights" permissions. Usability is working correctly.[Nothing can be done at this point.]
  • Correct ai.bridge sorting and filtering in the user widget. Across different users, permissions, and models.[Nothing can be done at this point.]
  • Connection tests with different correct authentications.[Nothing can be done at this point.]
  • The connection method change is automatically applied to users, everything is correct.[Nothing can be done at this point.]
  • If the user is in a multi-company and only has one active, everything works correctly.[Nothing can be done at this point.]
  • If the user is in multi-company mode and selects View +1 company, all ai.bridges are visible and executable. I believe only those from the active company (the one selected in the company change widget) should be displayed. Another option would be to display the company if it is configured in the ai.bridge configuration (e.g., company1 - magic1). This nomenclature could be a problem if the M2M company field is created in the ai.bridge model. [It can be added to the Roadmap; it is not considered urgent.]

By default I prefer to leaver records as no multicompany. If the company is selected, everything works as expected.

  • Tests were performed with filtering by company and different executions. The ai.bridge.execution correctly records the execution company.[Nothing can be done at this point.]
  • The company from which the payload was executed isn't transferred. Would that be necessary? If it is added, it would be "user_company."[It can be added to the Roadmap]

Well, I leave the company of the bridge. Imagine that you have company 1 and 2 selected, but main company is 1 and you execute on a record of company 2.... I prefer to leave the company of the bridge in order to avoid future errors

  • Would it be necessary to be able to select N companies instead of 1 in the ai.bridge model? [It can be added to the Roadmap]
  • Usage field works correctly.[Nothing can be done at this point.]

Copy link

@ValentinVinagre ValentinVinagre left a comment

Choose a reason for hiding this comment

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

Well.. Well...It's been a pleasure starting this great project with you, I hope this doesn't stop. Green light, you can now merge, go go 😃 👏🏻 👏🏻

Copy link

@HaraldPanten HaraldPanten left a comment

Choose a reason for hiding this comment

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

LGTM

@ValentinVinagre
Copy link

First merge in OCA 😄 thanks @etobella
/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

What a great day to merge this nice PR. Let's do it!
Prepared branch 16.0-ocabot-merge-pr-2-by-ValentinVinagre-bump-nobump, awaiting test results.

@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at 27323ab. Thanks a lot for contributing to OCA. ❤️

@OCA-git-bot OCA-git-bot merged commit e865255 into OCA:16.0 Jun 9, 2025
7 checks passed
@etobella etobella deleted the 16.0-add-bridge branch June 10, 2025 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants