Skip to content

Conversation

@DarioLodeiros
Copy link
Member

This pull request refactors the handling of reservation types and their pricing logic in the PMS module. The main improvement is the introduction of dedicated methods to determine which reservation types use night-based, service-based, or any pricing rules. This change centralizes and simplifies the logic, making it easier to extend and maintain. Additionally, UI visibility conditions are updated to align with the new logic, ensuring consistency between backend rules and the user interface.

Backend logic improvements:

  • Added three new methods in pms_folio.py_get_reservation_types_with_night_pricing, _get_reservation_types_with_service_pricing, and _get_reservation_types_with_any_pricing—to centralize and allow easy extension of reservation type pricing logic.
  • Updated business logic in pms_folio.py methods (_compute_sale_line_ids, _compute_pricelist_id, _compute_amount) to use the new reservation type methods instead of hardcoded values, ensuring consistency and flexibility. [1] [2] [3] [4] [5]
  • Modified _get_price_unit_line in pms_service.py to use the new service pricing reservation type method, replacing hardcoded checks.

User interface consistency:

  • Updated XML view files (pms_folio_views.xml, pms_reservation_views.xml) to adjust visibility conditions for fields and pages, now hiding elements only when reservation_type is 'out', matching the backend logic. [1] [2] [3] [4] [5]

@DarioLodeiros DarioLodeiros force-pushed the 16.0-pms_refact_reservation_type branch from c6925ae to 8231ee6 Compare November 30, 2025 11:15
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.

1 participant