Skip to content

Conversation

@devendra1973
Copy link

@devendra1973 devendra1973 commented Nov 11, 2025

Summary

Implemented AI-assisted translation wizard for OpenSPP.

Changes Included:

  • Created new module openspp_translations
  • Added model: translation_wizard.py
  • Added view: translation_wizard_view.xml
  • Added README and metadata cleanup

Testing

Successfully tested module installation and UI load in Odoo 17 (local environment).
@openspp-maintainers kindly review 🙏

@github-actions
Copy link


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @devendra1973, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request lays the groundwork for an AI-assisted translation feature within the OpenSPP system. It establishes a dedicated module, defines a temporary model to manage translation requests, and integrates the necessary user interface elements for accessibility. The initial setup uses a placeholder for the actual translation process, preparing the system for subsequent integration with external translation services.

Highlights

  • New Module Creation: A new module named openspp_translations has been added to house the AI translation functionality.
  • AI Translation Wizard: An initial scaffold for an AI translation wizard has been introduced, featuring a translation.wizard transient model.
  • User Interface Integration: A form view, window action, and a new menu item ('Translation' -> 'AI Translator') have been created to access the wizard.
  • Placeholder Translation Logic: The current implementation includes a stub for the translation logic, which will be replaced by real external API integrations in future PRs.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request provides a solid initial scaffold for the new AI translation wizard module. The structure is logical and follows Odoo conventions. However, I've identified two critical issues that would prevent the module from functioning as intended: an incorrect API decorator in the model and a syntax error in the XML view. Additionally, I've included a medium-severity suggestion to add access control definitions, which is a crucial aspect of security and usability in Odoo applications. Addressing these points will ensure the module is robust and ready for future development.

Comment on lines +10 to +13
@api.model
def translate_text(self):
# Simple placeholder logic (we fake translation for now)
self.translated_text = f"TRANSLATED: {self.source_text}"
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

The @api.model decorator is used incorrectly here. This method is intended to be called on a specific record of the wizard, so it should be an instance method. With @api.model, self becomes a class proxy, not a record instance, and accessing self.source_text would fail. Removing the decorator will make it a regular instance method, which is the correct approach here. I've also added self.ensure_one() as a good practice for instance methods to ensure they operate on a single record.

Suggested change
@api.model
def translate_text(self):
# Simple placeholder logic (we fake translation for now)
self.translated_text = f"TRANSLATED: {self.source_text}"
def translate_text(self):
self.ensure_one()
# Simple placeholder logic (we fake translation for now)
self.translated_text = f"TRANSLATED: {self.source_text}"

<menuitem id="menu_translation_root" name="Translation" sequence="10"/>
<menuitem id="menu_translation_tool" name="AI Translator" parent="menu_translation_root" action="action_translation_wizard"/>
</odoo>
o
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

There is a stray character 'o' at the end of this XML file, outside of the <odoo> root element. This will cause an XML parsing error when Odoo attempts to load the module, preventing it from being installed or updated. Please remove this character.

Comment on lines +6 to +8
'data': [
'views/translation_wizard_view.xml',
],
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The new model translation.wizard is missing access rights. Without an ir.model.access.csv file, only the superuser will be able to access this wizard. It's a security best practice in Odoo to explicitly define access rights for all models. I recommend creating a security/ir.model.access.csv file for the translation.wizard model and adding it to the data list in this manifest file. This will ensure that users with the appropriate permissions can use the translation tool.

Suggested change
'data': [
'views/translation_wizard_view.xml',
],
'data': [
'security/ir.model.access.csv',
'views/translation_wizard_view.xml',
],

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

This is the final PR Bugbot will review for you during this billing cycle

Your free Bugbot reviews will reset on November 17

Details

Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

@api.model
def translate_text(self):
# Simple placeholder logic (we fake translation for now)
self.translated_text = f"TRANSLATED: {self.source_text}"
Copy link

Choose a reason for hiding this comment

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

Bug: Decorator blocks instance access

The translate_text method uses @api.model decorator but accesses instance fields self.source_text and self.translated_text. When called from a button with type="object", the method receives a recordset but @api.model doesn't bind self to the record properly, causing the translation to fail. The decorator should be removed or changed to allow instance access.

Fix in Cursor Fix in Web

<menuitem id="menu_translation_root" name="Translation" sequence="10"/>
<menuitem id="menu_translation_tool" name="AI Translator" parent="menu_translation_root" action="action_translation_wizard"/>
</odoo>
o
Copy link

Choose a reason for hiding this comment

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

Bug: Stray Character Pollutes Output

A stray character o appears after the closing </odoo> tag, which looks like accidentally committed content that should be removed.

Fix in Cursor Fix in Web

@sonarqubecloud
Copy link

@devendra1973
Copy link
Author

Summary

Implemented AI-assisted translation wizard for OpenSPP.

Changes Included:

  • Created new module openspp_translations
  • Added model: translation_wizard.py
  • Added view: translation_wizard_view.xml
  • Added README and metadata cleanup

Testing

Successfully tested module installation and UI load in Odoo 17 (local environment). @openspp-maintainers kindly review 🙏
@openspp-maintainers kindly review 🙏

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants