Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
133 changes: 133 additions & 0 deletions pms_long_stay/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

==========================
PMS Long Stay Reservations
==========================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:395bdcdf5b0f56dd19fe0fed9c08bccb5219c106d24a8e0f78056c346ad06cd0
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpms-lightgray.png?logo=github
:target: https://github.com/OCA/pms/tree/16.0/pms_long_stay
:alt: OCA/pms
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/pms-16-0/pms-16-0-pms_long_stay
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/pms&target_branch=16.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module adds support for long-stay reservations in the PMS.

A new reservation type (``long_stay``) is introduced. When a reservation
of this type is created, it is automatically split into weekly or monthly
segments according to the configuration defined on the room type. The
reservation initially created by the user becomes the first segment, and
the remaining segments are generated automatically.

All segments are linked through a long-stay group, allowing coherent
management of the whole stay while preserving operational independence
of each segment.

For each segment, a corresponding long-stay service line is generated
automatically. The service is based on a dedicated product configured on
the room type, and its price is computed using the standard PMS service
pricing logic, including consumption-date rules. The date used for the
generated service line is configurable on the PMS Property, allowing the
service to be invoiced either at the start of the period or on the last
night of the segment.

The room type form is extended with long-stay configuration fields:

* Period type (weekly or monthly)
* Base period price
* Taxes for the long-stay product

The module integrates cleanly with the PMS pricing architecture and
provides extension hooks to allow other modules to introduce additional
reservation types or pricing rules.

**Table of contents**

.. contents::
:local:

Usage
=====

To create a long-stay reservation, set the reservation type to
``long_stay`` on a PMS reservation and save it. The reservation will be
automatically split into weekly or monthly segments depending on the
configuration of the related room type. The original reservation becomes
the first segment.

Each generated segment has its own check-in and check-out dates and is
linked to the others through a long-stay group.

For each segment, a long-stay service is created automatically:

* It uses the long-stay product configured on the room type.
* The price is computed via the standard PMS service pricing logic.
* The consumption date is the last night of the segment.

The date used for the generated service line depends on the
``long_stay_billing_timing`` field on the PMS Property:

* ``start``: the service line date is the segment check-in date.
* ``end``: the service line date is the last night of the segment
(checkout minus one day).

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/pms/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/pms/issues/new?body=module:%20pms_long_stay%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
~~~~~~~

* Roomdoo

Contributors
~~~~~~~~~~~~

* Dario Lodeiros <[email protected]>

Maintainers
~~~~~~~~~~~

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/pms <https://github.com/OCA/pms/tree/16.0/pms_long_stay>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions pms_long_stay/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
23 changes: 23 additions & 0 deletions pms_long_stay/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright 2020-21 Jose Luis Algara (Alda Hotels <https://www.aldahotels.es>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

{
"name": "PMS Long Stay Reservations",
"version": "16.0.1.0.0",
"summary": "Adds long stay reservation type and configuration per room type.",
"category": "Hotel/PMS",
"author": "Roomdoo, Odoo Community Association (OCA)",
"website": "https://roomdoo.com",
"license": "AGPL-3",
"depends": [
"pms",
"product",
],
"data": [
"views/pms_room_type_views.xml",
"views/pms_property_views.xml",
"security/ir.model.access.csv",
],
"installable": True,
"application": False,
}
6 changes: 6 additions & 0 deletions pms_long_stay/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from . import pms_reservation
from . import pms_room_type
from . import product_template
from . import pms_reservation_long_stay_group
from . import pms_property
from . import pms_folio
22 changes: 22 additions & 0 deletions pms_long_stay/models/pms_folio.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from odoo import fields, models


class PmsFolio(models.Model):
_inherit = "pms.folio"

reservation_type = fields.Selection(
selection_add=[("long_stay", "Long Stay")],
)

# ---------------------------------------------------------
# EXTEND SERVICE PRICING TYPES
# ---------------------------------------------------------
def _get_reservation_types_with_service_pricing(self):
"""
Extend base service pricing types to include 'long_stay' so that
long stay reservations also use standard service pricing logic.
"""
types = list(super()._get_reservation_types_with_service_pricing())
if "long_stay" not in types:
types.append("long_stay")
return tuple(types)
29 changes: 29 additions & 0 deletions pms_long_stay/models/pms_property.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
from odoo import fields, models


class PmsProperty(models.Model):
_inherit = "pms.property"

week_start_day = fields.Selection(
[
("monday", "Monday"),
("sunday", "Sunday"),
("saturday", "Saturday"),
],
string="Week Start Day",
default="monday",
help="Defines the first day of the week for long-stay splitting.",
)
long_stay_billing_timing = fields.Selection(
selection=[
("start", "Invoice at period start"),
("end", "Invoice at period end"),
],
string="Long Stay Billing Timing",
default="end",
help=(
"Defines whether long stay periods are invoiced at the beginning "
"or at the end of each period. This controls the date of the "
"generated long stay service lines."
),
)
Loading