Skip to content

[IMP] pms: add active field to board service#402

Open
DarioLodeiros wants to merge 1 commit into
OCA:16.0from
commitsun:16.0-add-active-board-services
Open

[IMP] pms: add active field to board service#402
DarioLodeiros wants to merge 1 commit into
OCA:16.0from
commitsun:16.0-add-active-board-services

Conversation

@DarioLodeiros
Copy link
Copy Markdown
Member

Summary

Allow archiving board service regimes that are no longer commercialised (seasonal packages, retired group rates, board services that have been replaced) without affecting historical reservations or invoices that reference them.

Mirrors the same pattern recently introduced for room.closure.reason (#xxxx).

Behaviour

The active flag lives on pms.board.service as the source of truth and its write override propagates archive/restore down to:

  • pms.board.service.line (composition of the regime)
  • pms.board.service.room.type (per-room-type assignment)
  • pms.board.service.room.type.line (composition at room-type level)

Each model also exposes its own active field so individual rows can be toggled independently when needed (for example, retire a regime only for a specific room type).

Historical pms.reservation.board_service_room_id references remain intact since the rows are archived rather than deleted; the regime simply stops appearing in selection dropdowns for new operations.

UI

  • pms.board.service and pms.board.service.room.type forms gain the standard "Archived" ribbon.
  • pms.board.service form has a dedicated search view with an "Archived" filter, wired to the configuration menu action.

Test plan

  • Existing board-service tests pass (-i pms --test-tags /pms:TestBoardService).
  • New regression test test_archive_board_service_propagates_to_children covers forward and reverse propagation of the active flag.
  • Manual: archive a board service from the UI → the ribbon appears, the regime no longer shows up in reservation dropdowns, and the "Archived" filter on the configuration list view brings it back.

Allow archiving board service regimes that are no longer commercialised
(seasonal packages, retired group rates, board services that have been
replaced) without affecting historical reservations or invoices that
reference them.

The active flag lives on pms.board.service as the source of truth and
its write override propagates archive/restore down to:

- pms.board.service.line (composition of the regime)
- pms.board.service.room.type (per-room-type assignment)
- pms.board.service.room.type.line (composition at room-type level)

Each model also exposes its own active field so individual rows can be
toggled independently when needed (e.g. retire a regime only for a
specific room type).

UI:

- pms.board.service and pms.board.service.room.type forms gain the
  standard "Archived" ribbon.
- pms.board.service form has a dedicated search view with an "Archived"
  filter, wired to the configuration menu.

Historical pms.reservation.board_service_room_id references remain
intact since the rows are archived rather than deleted; the regime
simply stops appearing in selection dropdowns for new operations.

Added a regression test in tests/test_pms_board_service.py covering the
forward and reverse propagation of the active flag.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants