Skip to content

Conversation

@Dylanvenancio
Copy link
Contributor

@Dylanvenancio Dylanvenancio commented Oct 28, 2025

Video presentation

Screencast.from.06.01.2026.16.58.21.webm

@gemini-code-assist
Copy link

Summary of Changes

Hello @Dylanvenancio, 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 significantly enhances the user experience for composing new letters by introducing a dedicated modal for selecting pre-written letter templates. Instead of automatically loading a single template, users can now browse and choose from a list of active templates. This feature required updates to the backend to provide the list of templates and fetch specific ones, as well as a complete overhaul of the frontend JavaScript and the addition of the modal structure in the XML template. A previous constraint regarding non-overlapping template schedules was also removed as part of this change.

Highlights

  • New Template Selection UI: Implemented a new modal-based user interface on the 'new letter' page, allowing users to select from a list of active pre-written letter templates.
  • Backend Template API Enhancement: The Python controller now fetches all active pre-written letter templates for display in the new modal and supports fetching a specific template by its ID.
  • Removed Template Overlap Validation: The validation logic that previously prevented pre-written letter templates from having overlapping active schedules has been removed from the model.
  • Frontend Template Loading Refactor: The JavaScript logic for loading letter templates has been refactored to integrate with the new modal selection, fetching templates on user click rather than initial page load or child selection changes.
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

@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 introduces a feature for using pre-written text templates in letters. It includes backend changes to fetch these templates, UI modifications with a new modal for selection, and JavaScript for handling the logic. A key change is the removal of a validation constraint that previously prevented overlapping active templates. My review highlights several points, including missing error handling in JavaScript, leftover debugging code, an internationalization issue, and a UI inconsistency that could confuse users.

@ecino ecino changed the title T2690 T2690 - Selectable prewritten texts Nov 6, 2025
Dylanvenancio and others added 2 commits November 20, 2025 17:01
…ing logic

[FEAT] add template selection modal and enhance letter template fetching logic
@ecino
Copy link
Member

ecino commented Nov 20, 2025

/gemini review

Copy link

@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 introduces a new feature allowing users to select from pre-written text suggestions when composing a letter. The changes are well-distributed across the backend (Python controllers and Odoo models) and frontend (JavaScript and XML templates), and the implementation is largely consistent. My review identifies a few key areas for improvement: a critical bug in the Python controller related to unsafe type conversion that could lead to a server error, a regression in frontend error handling that could mask backend issues, and a visual bug in a button's styling. I have also included suggestions to enhance code quality by removing leftover debug statements, improving JavaScript structure, and increasing the accessibility of UI components.

@Shayan105
Copy link
Member

/gemini review

Copy link

@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 introduces a feature for users to select pre-written texts for their letters. The changes span across the backend (Python/Odoo models and controllers) and frontend (JavaScript, XML templates). The backend is updated to allow multiple active text templates and to fetch them. The frontend is updated with a new UI for selecting these templates. My review has identified a critical bug where the selected text template is not being saved, a high-severity issue with error handling in a fetch request, and a minor typo in a log message. I've provided suggestions to fix these issues. Overall, the changes are well-structured to implement the new feature, but the identified bugs need to be addressed for it to function correctly.

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.

4 participants