-
-
Notifications
You must be signed in to change notification settings - Fork 92
[IMP]pms: ADD multicurrency views fetaures #354
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: 16.0
Are you sure you want to change the base?
Conversation
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.
Pull Request Overview
This pull request standardizes monetary field handling across the PMS (Property Management System) by replacing fields.Float with fields.Monetary for all money-related fields and updating corresponding view widgets to use the monetary widget for proper currency formatting.
- Replaces all monetary
fields.Floatdefinitions withfields.Monetaryacross PMS models - Updates XML views to use
monetarywidget for consistent currency display formatting - Adds hidden
currency_idfields to views and removes redundant currency options
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| pms/models/pms_folio.py | Updates commission field from Float to Monetary |
| pms/models/pms_reservation.py | Converts commission_amount, price_tax, discount, and services_discount to Monetary fields |
| pms/models/pms_reservation_line.py | Changes price and price_day_total fields to Monetary type |
| pms/models/pms_service.py | Updates price_tax and discount fields to use Monetary type |
| pms/models/pms_service_line.py | Converts price_unit and price_day_tax to Monetary fields |
| pms/views/pms_folio_views.xml | Adds monetary widgets and removes redundant currency options from folio views |
| pms/views/pms_reservation_views.xml | Updates reservation views with monetary widgets, adds currency context, and improves UI formatting |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| <group | ||
| class="oe_subtotal_footer oe_right oe_inline" | ||
| name="folio_total" | ||
| widget="monetary" |
Copilot
AI
Sep 21, 2025
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.
The widget="monetary" attribute is incorrectly placed on a <group> element. The monetary widget should only be applied to individual field elements, not group containers.
| widget="monetary" |
jesusVMayor
left a comment
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.
The widget monetary its not needed in the views if the field is defined as monetary.
Also remove the widget in pending_amount in folio and folio_pending_amount in reservation
| > | ||
| <tree name="Days"> | ||
| <field name="date" /> | ||
| <field name="date" widget="date" /> |
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.
?
This pull request standardizes the handling of monetary fields throughout the PMS (Property Management System) models and views. The main change is replacing all
fields.Floatdefinitions for monetary values withfields.Monetaryin the models, and ensuring the corresponding widgets in the views use themonetarywidget. This improves currency handling, display formatting, and consistency across the application.Model changes: Monetary field standardization
fields.Floatfields representing monetary values (such ascommission,commission_amount,price_tax,discount,services_discount,price,price_day_total,price_unit,price_day_tax) withfields.MonetaryinPmsFolio,PmsReservation,PmsReservationLine,PmsService, andPmsServiceLinemodels. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]View changes: Consistent monetary display
monetarywidget, ensuring proper currency formatting in the UI for fields such asamount_untaxed,amount_tax,commission,price_unit,amount,price,price_day_total,price_subtotal,price_tax,discount,price_total,commission_amount, andfolio_pending_amount. [1] [2] [3] [4] [5] [6] [7]Currency context improvements
currency_idfields where needed in tree and form views to ensure that the correct currency context is available for monetary fields. [1] [2]Cleanup of widget options
options="{'currency_field': 'currency_id'}"from XML field definitions, as themonetarywidget now automatically handles currency context whencurrency_idis present. [1] [2] [3]Minor UI enhancements
separatorfor "Nights" in the reservation detail page and set thedatefield in service lines to use thedatewidget for improved readability. [1] [2]These changes collectively improve the accuracy, consistency, and user experience of monetary data throughout the PMS application.