-
Notifications
You must be signed in to change notification settings - Fork 10
[T2866] - Dynamic Ordering System for Frontend Components #248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 14.0-MyCompassion2.0
Are you sure you want to change the base?
[T2866] - Dynamic Ordering System for Frontend Components #248
Conversation
Summary of ChangesHello @SlWa99, 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 introduces a crucial feature for MyCompassion administrators, enabling them to manually control the display order of volunteering opportunities and donation products on the frontend. By integrating a drag-and-drop sorting mechanism within the Odoo backend, this change provides greater flexibility and customization for content presentation, ensuring that the most relevant items can be prioritized. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this 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 manual sorting capability for donation products, which is a great enhancement for content managers. The implementation is well-thought-out, especially the approach for product.template which avoids modifying the base model's _order to prevent side effects. I have a couple of suggestions to improve the stability of the sorting and the clarity of the code.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Activation of Backend Manual Sorting for Volunteering Opportunities and Donations
Description
Context and Problem
Currently, on the MyCompassion website, the display order of frontend components for volunteering opportunities (
advocate.engagement) and donations (product.template) relies on the default database order.There is no mechanism allowing administrators to define a custom display priority through the Odoo backend.
Solution
This PR enables a dynamic and configurable manual sorting system managed directly from the backend via drag-and-drop (handle widget).
The order defined by administrators is strictly respected on the MyCompassion website.
Backend configuration locations:
Functional Note
A page refresh (F5) is required on the website to reflect ordering changes.
The frontend is not reactive in real time and displays the database state at page load (see technical implementation details below).
Technical Implementation
The approach differs depending on the model to ensure system stability.
1.
advocate.engagementAll required sorting infrastructure already existed in the codebase.
Model
sequencefield already defined_orderattribute already configuredView
handlewidget already present in the list viewResult
The sorting mechanism works natively with no additional changes required for this model.
2.
product.templateThis model has a default Odoo ordering that overrides manual sorting when the backend page is refreshed.
To enable manual sorting without impacting other Odoo applications (e.g. Sales), the following approach was implemented:
Model (
product_template.py)_orderor thesequencefield to avoid side effects in other modules.View (
product_view.xml)product.product_template_tree_viewis inherited.sequenceorder when loading the page.Controller (
my2_gifts.py)Results
Test Scenarios
Scenario 1: Custom Random Order
Scenario 2: Order Modification