mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[IMP] reservation state cancel key, improvement views and refactoring
This commit is contained in:
@@ -4,25 +4,22 @@
|
||||
<record model="ir.sequence" id="seq_pms_folio">
|
||||
<field name="name">PMS Folio</field>
|
||||
<field name="code">pms.folio</field>
|
||||
<field name="prefix">F/%(y)s</field>
|
||||
<field name="suffix">%(sec)s</field>
|
||||
<field name="padding">4</field>
|
||||
<field name="prefix">F%(y)s</field>
|
||||
<field name="padding">5</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.sequence" id="seq_pms_reservation">
|
||||
<field name="name">PMS Reservation</field>
|
||||
<field name="code">pms.reservation</field>
|
||||
<field name="prefix">R/%(y)s</field>
|
||||
<field name="suffix">%(sec)s</field>
|
||||
<field name="padding">4</field>
|
||||
<field name="prefix">R%(y)s</field>
|
||||
<field name="padding">6</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.sequence" id="seq_pms_checkin">
|
||||
<field name="name">PMS Checkin</field>
|
||||
<field name="code">pms.checkin.partner</field>
|
||||
<field name="prefix">C/%(y)s</field>
|
||||
<field name="suffix">%(sec)s</field>
|
||||
<field name="padding">4</field>
|
||||
<field name="prefix">%(y)s</field>
|
||||
<field name="padding">6</field>
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
'checkin': (DateTime.today() + timedelta(days=14)),
|
||||
'checkout': (DateTime.today() + timedelta(days=16)),
|
||||
'adults': 1,
|
||||
'state': 'cancelled',
|
||||
'state': 'cancel',
|
||||
})]"
|
||||
/>
|
||||
</record>
|
||||
@@ -388,7 +388,7 @@
|
||||
'checkin': (DateTime.today() + timedelta(days=22)),
|
||||
'checkout': (DateTime.today() + timedelta(days=23)),
|
||||
'adults': 1,
|
||||
'state': 'cancelled',
|
||||
'state': 'cancel',
|
||||
})]"
|
||||
/>
|
||||
</record>
|
||||
|
||||
@@ -110,7 +110,7 @@ class PmsCheckinPartner(models.Model):
|
||||
("precheckin", "Pending arrival"),
|
||||
("onboard", "On Board"),
|
||||
("done", "Out"),
|
||||
("cancelled", "Cancelled"),
|
||||
("cancel", "Cancelled"),
|
||||
],
|
||||
compute="_compute_state",
|
||||
)
|
||||
@@ -279,23 +279,6 @@ class PmsCheckinPartner(models.Model):
|
||||
elif not record.nationality_id:
|
||||
record.nationality_id = False
|
||||
|
||||
@api.depends("reservation_id", "folio_id", "reservation_id.preferred_room_id")
|
||||
def _compute_identifier(self):
|
||||
for record in self:
|
||||
# TODO: Identifier
|
||||
checkins = []
|
||||
if record.reservation_id.filtered("preferred_room_id"):
|
||||
checkins = record.reservation_id.checkin_partner_ids
|
||||
record.identifier = (
|
||||
record.reservation_id.preferred_room_id.name
|
||||
+ "-"
|
||||
+ str(len(checkins) - 1)
|
||||
)
|
||||
elif record.folio_id:
|
||||
record.identifier = record.folio_id.name + "-" + str(len(checkins) - 1)
|
||||
else:
|
||||
record.identifier = False
|
||||
|
||||
@api.depends("reservation_id", "reservation_id.folio_id")
|
||||
def _compute_folio_id(self):
|
||||
for record in self.filtered("reservation_id"):
|
||||
@@ -306,9 +289,9 @@ class PmsCheckinPartner(models.Model):
|
||||
for record in self:
|
||||
if not record.state:
|
||||
record.state = "draft"
|
||||
if record.reservation_id.state == "cancelled":
|
||||
record.state = "cancelled"
|
||||
elif record.state in ("draft", "cancelled"):
|
||||
if record.reservation_id.state == "cancel":
|
||||
record.state = "cancel"
|
||||
elif record.state in ("draft", "cancel"):
|
||||
if any(
|
||||
not getattr(record, field)
|
||||
for field in record._checkin_mandatory_fields()
|
||||
@@ -509,7 +492,7 @@ class PmsCheckinPartner(models.Model):
|
||||
else vals["pms_property_id"]
|
||||
)
|
||||
pms_property = self.env["pms.property"].browse(pms_property_id)
|
||||
vals["identifier"] = pms_property.folio_sequence_id._next_do()
|
||||
vals["identifier"] = pms_property.checkin_sequence_id._next_do()
|
||||
return super(PmsCheckinPartner, self).create(vals)
|
||||
if len(draft_checkins) > 0:
|
||||
draft_checkins[0].write(vals)
|
||||
|
||||
@@ -572,14 +572,14 @@ class PmsFolio(models.Model):
|
||||
def _compute_number_of_rooms(self):
|
||||
for folio in self:
|
||||
folio.number_of_rooms = len(
|
||||
folio.reservation_ids.filtered(lambda a: a.state != "cancelled")
|
||||
folio.reservation_ids.filtered(lambda a: a.state != "cancel")
|
||||
)
|
||||
|
||||
@api.depends("reservation_ids", "reservation_ids.state")
|
||||
def _compute_number_of_cancelled_rooms(self):
|
||||
for folio in self:
|
||||
folio.number_of_cancelled_rooms = len(
|
||||
folio.reservation_ids.filtered(lambda a: a.state == "cancelled")
|
||||
folio.reservation_ids.filtered(lambda a: a.state == "cancel")
|
||||
)
|
||||
|
||||
@api.depends("service_ids", "service_ids.product_qty")
|
||||
@@ -912,7 +912,7 @@ class PmsFolio(models.Model):
|
||||
total = record.amount_total
|
||||
# REVIEW: Must We ignored services in cancelled folios
|
||||
# pending amount?
|
||||
if record.state == "cancelled":
|
||||
if record.state == "cancel":
|
||||
total = total - sum(record.service_ids.mapped("price_total"))
|
||||
# Compute 'payment_state'.
|
||||
if total <= paid_out:
|
||||
@@ -938,7 +938,7 @@ class PmsFolio(models.Model):
|
||||
for record in self:
|
||||
if record.reservation_type == "normal" and record.reservation_ids:
|
||||
filtered_reservs = record.reservation_ids.filtered(
|
||||
lambda x: x.state != "cancelled"
|
||||
lambda x: x.state != "cancel"
|
||||
)
|
||||
mapped_checkin_partner = filtered_reservs.mapped(
|
||||
"checkin_partner_ids.id"
|
||||
@@ -1122,7 +1122,7 @@ class PmsFolio(models.Model):
|
||||
def action_cancel(self):
|
||||
for folio in self:
|
||||
for reservation in folio.reservation_ids.filtered(
|
||||
lambda res: res.state != "cancelled"
|
||||
lambda res: res.state != "cancel"
|
||||
):
|
||||
reservation.action_cancel()
|
||||
self.write(
|
||||
|
||||
@@ -236,8 +236,8 @@ class PmsReservation(models.Model):
|
||||
compute="_compute_pending_checkin_data",
|
||||
)
|
||||
ratio_checkin_data = fields.Integer(
|
||||
string="Pending Checkin Data",
|
||||
help="Proportion of guest data pending at checkin",
|
||||
string="Complete cardex",
|
||||
help="Proportion of guest data complete at checkin",
|
||||
compute="_compute_ratio_checkin_data",
|
||||
)
|
||||
ready_for_checkin = fields.Boolean(
|
||||
@@ -265,7 +265,7 @@ class PmsReservation(models.Model):
|
||||
allowed_cancel = fields.Boolean(
|
||||
string="Allowed cancel",
|
||||
help="Technical field, Indicates that reservation can be cancelled,"
|
||||
"that happened when state is 'cancelled', 'done', or 'departure_delayed'",
|
||||
"that happened when state is 'cancel', 'done', or 'departure_delayed'",
|
||||
compute="_compute_allowed_cancel",
|
||||
search="_search_allowed_cancel",
|
||||
)
|
||||
@@ -333,7 +333,7 @@ class PmsReservation(models.Model):
|
||||
("confirm", "Pending arrival"),
|
||||
("onboard", "On Board"),
|
||||
("done", "Out"),
|
||||
("cancelled", "Cancelled"),
|
||||
("cancel", "Cancelled"),
|
||||
("arrival_delayed", "Arrival Delayed"),
|
||||
("departure_delayed", "Departure delayed"),
|
||||
],
|
||||
@@ -609,8 +609,8 @@ class PmsReservation(models.Model):
|
||||
"departure_delayed",
|
||||
):
|
||||
record.priority = 1
|
||||
elif record.state == "cancelled":
|
||||
record.priority = record.cancelled_priority()
|
||||
elif record.state == "cancel":
|
||||
record.priority = record.cancel_priority()
|
||||
elif record.state == "onboard":
|
||||
record.priority = record.onboard_priority()
|
||||
elif record.state in ("draf", "confirm"):
|
||||
@@ -618,7 +618,7 @@ class PmsReservation(models.Model):
|
||||
elif record.state == "done":
|
||||
record.priority = record.reservations_past_priority()
|
||||
|
||||
def cancelled_priority(self):
|
||||
def cancel_priority(self):
|
||||
self.ensure_one()
|
||||
if self.folio_pending_amount > 0:
|
||||
return 2
|
||||
@@ -731,7 +731,7 @@ class PmsReservation(models.Model):
|
||||
def _compute_allowed_room_ids(self):
|
||||
for reservation in self:
|
||||
if reservation.checkin and reservation.checkout:
|
||||
if reservation.overbooking or reservation.state in ("cancelled"):
|
||||
if reservation.overbooking or reservation.state in ("cancel"):
|
||||
reservation.allowed_room_ids = self.env["pms.room"].search(
|
||||
[("active", "=", True)]
|
||||
)
|
||||
@@ -930,7 +930,9 @@ class PmsReservation(models.Model):
|
||||
@api.depends("pending_checkin_data")
|
||||
def _compute_ratio_checkin_data(self):
|
||||
self.ratio_checkin_data = 0
|
||||
for reservation in self.filtered(lambda r: r.adults > 0):
|
||||
for reservation in self.filtered(
|
||||
lambda r: r.adults > 0 and r.state != "cancel"
|
||||
):
|
||||
reservation.ratio_checkin_data = (
|
||||
(reservation.adults - reservation.pending_checkin_data)
|
||||
* 100
|
||||
@@ -966,7 +968,7 @@ class PmsReservation(models.Model):
|
||||
for record in self:
|
||||
record.allowed_cancel = (
|
||||
True
|
||||
if (record.state not in ["cancelled", "done", "departure_delayed"])
|
||||
if (record.state not in ["cancel", "done", "departure_delayed"])
|
||||
else False
|
||||
)
|
||||
|
||||
@@ -1341,7 +1343,7 @@ class PmsReservation(models.Model):
|
||||
_("Invalid domain right operand %s for left of cancel", value)
|
||||
)
|
||||
return [
|
||||
("state", "not in", ("cancelled", "done", "departure_delayed")),
|
||||
("state", "not in", ("cancel", "done", "departure_delayed")),
|
||||
]
|
||||
|
||||
def _search_checkin_partner_pending(self, operator, value):
|
||||
@@ -1573,7 +1575,7 @@ class PmsReservation(models.Model):
|
||||
raise ValidationError(_("Partner contact name is required"))
|
||||
vals.update(default_vals)
|
||||
elif "pms_property_id" in vals and (
|
||||
"partner_id" in vals or "agency_id" in vals
|
||||
"partner_name" in vals or "partner_id" in vals or "agency_id" in vals
|
||||
):
|
||||
folio_vals = {
|
||||
"pms_property_id": vals["pms_property_id"],
|
||||
@@ -1598,9 +1600,7 @@ class PmsReservation(models.Model):
|
||||
}
|
||||
)
|
||||
else:
|
||||
raise ValidationError(
|
||||
_("The client and Property are mandatory in the reservation")
|
||||
)
|
||||
raise ValidationError(_("The Property are mandatory in the reservation"))
|
||||
if vals.get("name", _("New")) == _("New") or "name" not in vals:
|
||||
pms_property_id = (
|
||||
self.env.user.get_active_property_ids()[0]
|
||||
@@ -1632,7 +1632,7 @@ class PmsReservation(models.Model):
|
||||
def autocheckout(self):
|
||||
reservations = self.env["pms.reservation"].search(
|
||||
[
|
||||
("state", "not in", ["done", "cancelled"]),
|
||||
("state", "not in", ["done", "cancel"]),
|
||||
("checkout", "<", fields.Date.today()),
|
||||
]
|
||||
)
|
||||
@@ -1669,7 +1669,7 @@ class PmsReservation(models.Model):
|
||||
|
||||
def action_cancel(self):
|
||||
for record in self:
|
||||
# else state = cancelled
|
||||
# else state = cancel
|
||||
if not record.allowed_cancel:
|
||||
raise UserError(_("This reservation cannot be cancelled"))
|
||||
else:
|
||||
@@ -1680,8 +1680,8 @@ class PmsReservation(models.Model):
|
||||
)
|
||||
if self._context.get("no_penalty", False):
|
||||
_logger.info("Modified Reservation - No Penalty")
|
||||
record.write({"state": "cancelled", "cancelled_reason": cancel_reason})
|
||||
# record._compute_cancelled_discount()
|
||||
record.write({"state": "cancel", "cancelled_reason": cancel_reason})
|
||||
# record._compute_cancel_discount()
|
||||
record.folio_id._compute_amount()
|
||||
|
||||
def action_assign(self):
|
||||
|
||||
@@ -367,10 +367,7 @@ class PmsReservationLine(models.Model):
|
||||
@api.depends("reservation_id.state", "reservation_id.overbooking")
|
||||
def _compute_occupies_availability(self):
|
||||
for line in self:
|
||||
if (
|
||||
line.reservation_id.state == "cancelled"
|
||||
or line.reservation_id.overbooking
|
||||
):
|
||||
if line.reservation_id.state == "cancel" or line.reservation_id.overbooking:
|
||||
line.occupies_availability = False
|
||||
else:
|
||||
line.occupies_availability = True
|
||||
@@ -383,7 +380,7 @@ class PmsReservationLine(models.Model):
|
||||
# TODO: Review cancel logic
|
||||
# reservation = line.reservation_id
|
||||
# pricelist = reservation.pricelist_id
|
||||
# if reservation.state == "cancelled":
|
||||
# if reservation.state == "cancel":
|
||||
# if (
|
||||
# reservation.cancelled_reason
|
||||
# and pricelist
|
||||
@@ -468,7 +465,7 @@ class PmsReservationLine(models.Model):
|
||||
@api.constrains("state")
|
||||
def constrains_service_cancel(self):
|
||||
for record in self:
|
||||
if record.state == "cancelled":
|
||||
if record.state == "cancel":
|
||||
room_services = record.reservation_id.service_ids
|
||||
for service in room_services:
|
||||
cancel_lines = service.service_line_ids.filtered(
|
||||
|
||||
@@ -176,9 +176,9 @@ class PmsServiceLine(models.Model):
|
||||
# TODO: Review cancel logic
|
||||
# reservation = line.reservation_id.reservation_id
|
||||
# pricelist = reservation.pricelist_id
|
||||
# if reservation.state == "cancelled":
|
||||
# if reservation.state == "cancel":
|
||||
# if (
|
||||
# reservation.cancelled_reason
|
||||
# reservation.cancel_reason
|
||||
# and pricelist
|
||||
# and pricelist.cancelation_rule_id
|
||||
# ):
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 12 KiB |
@@ -182,7 +182,7 @@ class TestPmsFolioSaleLine(TestPms):
|
||||
|
||||
def test_comp_fsl_rooms_one_full_cancel_discount(self):
|
||||
# TEST CASE
|
||||
# 2-night reservation with 100% cancelled discount for 1 night
|
||||
# 2-night reservation with 100% cancel discount for 1 night
|
||||
# should generate just 1 reservation sale line because the
|
||||
# full cancel discount shouldn't be present @ invoice lines
|
||||
|
||||
@@ -560,7 +560,7 @@ class TestPmsFolioSaleLine(TestPms):
|
||||
|
||||
def test_comp_fsl_board_services_one_full_cancel_discount(self):
|
||||
# TEST CASE
|
||||
# 2-night reservation with 100% cancelled discount for 1 board service
|
||||
# 2-night reservation with 100% cancel discount for 1 board service
|
||||
# should generate just 1 board service sale line because the
|
||||
# full cancel discount shouldn't be present @ invoice lines
|
||||
|
||||
|
||||
@@ -896,7 +896,7 @@ class TestPmsReservations(common.SavepointCase):
|
||||
)
|
||||
|
||||
@freeze_time("1981-11-10")
|
||||
def test_cancelled_pending_amount_priority_reservation(self):
|
||||
def test_cancel_pending_amount_priority_reservation(self):
|
||||
"""
|
||||
Cancelled with pending payments reservation must have priority = 2
|
||||
------
|
||||
@@ -1672,7 +1672,7 @@ class TestPmsReservations(common.SavepointCase):
|
||||
def test_reservation_action_cancel(self):
|
||||
# TEST CASE
|
||||
# the reservation action cancel
|
||||
# change the state of the reservation to 'cancelled'
|
||||
# change the state of the reservation to 'cancel'
|
||||
# ARRANGE
|
||||
self.create_common_scenario()
|
||||
res = self.env["pms.reservation"].create(
|
||||
@@ -1687,7 +1687,7 @@ class TestPmsReservations(common.SavepointCase):
|
||||
# ACT
|
||||
res.action_cancel()
|
||||
# ASSERT
|
||||
self.assertEqual(res.state, "cancelled", "The reservation should be cancelled")
|
||||
self.assertEqual(res.state, "cancel", "The reservation should be cancelled")
|
||||
|
||||
@freeze_time("1981-11-01")
|
||||
def test_reservation_action_checkout(self):
|
||||
@@ -2210,7 +2210,7 @@ class TestPmsReservations(common.SavepointCase):
|
||||
}
|
||||
)
|
||||
|
||||
reservation.state = "cancelled"
|
||||
reservation.state = "cancel"
|
||||
|
||||
with self.assertRaises(UserError):
|
||||
reservation.action_cancel()
|
||||
|
||||
@@ -89,7 +89,7 @@
|
||||
editable="bottom"
|
||||
decoration-danger="state == 'draft'"
|
||||
decoration-info="state == 'done'"
|
||||
decoration-muted="state == 'cancelled'"
|
||||
decoration-muted="state == 'cancel'"
|
||||
decoration-success="state == 'onboard'"
|
||||
>
|
||||
<button
|
||||
@@ -133,7 +133,7 @@
|
||||
create="false"
|
||||
decoration-danger="state == 'draft'"
|
||||
decoration-info="state == 'done'"
|
||||
decoration-muted="state == 'cancelled'"
|
||||
decoration-muted="state == 'cancel'"
|
||||
decoration-success="state == 'onboard'"
|
||||
>
|
||||
<button
|
||||
@@ -174,7 +174,7 @@
|
||||
<tree
|
||||
create="false"
|
||||
decoration-danger="state == 'draft'"
|
||||
decoration-muted="state == 'cancelled' or state =='done'"
|
||||
decoration-muted="state == 'cancel' or state =='done'"
|
||||
decoration-success="state == 'onboard'"
|
||||
>
|
||||
<button
|
||||
@@ -262,7 +262,7 @@
|
||||
/>
|
||||
<img
|
||||
alt="Cancelled"
|
||||
t-if="record.state.raw_value === 'cancelled'"
|
||||
t-if="record.state.raw_value === 'cancel'"
|
||||
t-att-src=""pms/static/description/avatar.png""
|
||||
/>
|
||||
</t>
|
||||
@@ -401,7 +401,7 @@
|
||||
string="Future"
|
||||
name="future"
|
||||
domain="[('checkin', '>=', context_today().strftime('%Y-%m-%d')),
|
||||
('state', 'not in', ['cancelled'])]"
|
||||
('state', 'not in', ['cancel'])]"
|
||||
help="Show all future checkins"
|
||||
/>
|
||||
<group expand="0" string="Group By">
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
class="oe_stat_button"
|
||||
name="%(open_pms_reservation_form_tree_all)d"
|
||||
icon="fa-window-close"
|
||||
context="{'search_default_folio_id': id, 'default_folio_id': id, 'search_default_cancelled': True}"
|
||||
context="{'search_default_folio_id': id, 'default_folio_id': id, 'search_default_cancel': True}"
|
||||
attrs="{'invisible': [('number_of_cancelled_rooms', '=', 0)]}"
|
||||
>
|
||||
<field
|
||||
@@ -565,7 +565,7 @@
|
||||
<field
|
||||
name="payment_state"
|
||||
decoration-success="payment_state == 'paid'"
|
||||
decoration-danger="payment_state == 'not_paid' and state in ['cancelled','onboard','done','arrival_delayed','departure_delayed']"
|
||||
decoration-danger="payment_state == 'not_paid' and state in ['cancel','onboard','done','arrival_delayed','departure_delayed']"
|
||||
decoration-info="payment_state == 'not_paid' and state in ['draft','confirm',]"
|
||||
decoration-warning="payment_state == 'partial'"
|
||||
widget="badge"
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
string="Confirm"
|
||||
class="oe_highlight"
|
||||
type="object"
|
||||
attrs="{'invisible':[('state','not in',('draft','cancelled'))]}"
|
||||
attrs="{'invisible':[('state','not in',('draft','cancel'))]}"
|
||||
/>
|
||||
<button
|
||||
name="action_assign"
|
||||
@@ -223,7 +223,7 @@
|
||||
/>
|
||||
<div
|
||||
class="card bg-danger mb8"
|
||||
attrs="{'invisible': [('state', 'not in', ('cancelled'))]}"
|
||||
attrs="{'invisible': [('state', 'not in', ('cancel'))]}"
|
||||
>
|
||||
<div class="card-body bg-danger">
|
||||
<i class="fa fa-danger" /> Cancelled Reservation!
|
||||
@@ -346,7 +346,7 @@
|
||||
/>-->
|
||||
<field
|
||||
name="cancelled_reason"
|
||||
attrs="{'invisible': [('state', 'not in', ('cancelled'))]}"
|
||||
attrs="{'invisible': [('state', 'not in', ('cancel'))]}"
|
||||
/>
|
||||
<field
|
||||
name="adults"
|
||||
@@ -471,7 +471,7 @@
|
||||
<field name="discount" />
|
||||
<field
|
||||
name="cancel_discount"
|
||||
attrs="{'column_invisible': [('parent.state','!=','cancelled')]}"
|
||||
attrs="{'column_invisible': [('parent.state','!=','cancel')]}"
|
||||
/>
|
||||
<field name="pms_property_id" invisible="1" />
|
||||
</tree>
|
||||
@@ -659,22 +659,14 @@
|
||||
decoration-bf="splitted"
|
||||
js_class="pms_booking_engine_request_tree"
|
||||
>
|
||||
<!--TODO: charget booking engine button (view type list is not present
|
||||
in the view registry -->
|
||||
<!--js_class="pms_booking_engine_request_tree"-->
|
||||
<field name="folio_id" optional="show" decoration-bf="1" />
|
||||
<field name="name" optional="show" />
|
||||
<field name="splitted" invisible="1" />
|
||||
<field name="pricelist_id" invisible="1" />
|
||||
<field name="rooms" />
|
||||
<field name="checkin" />
|
||||
<field name="checkout" />
|
||||
<field name="nights" />
|
||||
<button
|
||||
type="object"
|
||||
class="oe_stat_button"
|
||||
icon="fa-file"
|
||||
name="open_folio"
|
||||
/>
|
||||
<field name="folio_id" decoration-bf="1" />
|
||||
<field name="allowed_room_ids" invisible="1" />
|
||||
<field name="partner_id" invisible="1" />
|
||||
<field name="partner_name" />
|
||||
@@ -696,7 +688,7 @@
|
||||
decoration-success="state == 'onboard'"
|
||||
decoration-info="state == 'confirm'"
|
||||
decoration-primary="state == 'departure_delayed'"
|
||||
decoration-danger="state == 'cancelled'"
|
||||
decoration-danger="state == 'cancel'"
|
||||
decoration-bf="state == 'draft'"
|
||||
decoration-warning="state == 'arrival_delayed'"
|
||||
widget="badge"
|
||||
@@ -705,7 +697,7 @@
|
||||
<field
|
||||
name="folio_payment_state"
|
||||
decoration-success="folio_payment_state == 'paid'"
|
||||
decoration-danger="folio_payment_state == 'not_paid' and state in ['cancelled','onboard','done','arrival_delayed','departure_delayed']"
|
||||
decoration-danger="folio_payment_state == 'not_paid' and state in ['cancel','onboard','done','arrival_delayed','departure_delayed']"
|
||||
decoration-info="folio_payment_state == 'not_paid' and state in ['draft','confirm',]"
|
||||
decoration-warning="folio_payment_state == 'partial'"
|
||||
widget="badge"
|
||||
@@ -790,8 +782,8 @@
|
||||
/>
|
||||
<filter
|
||||
string="Cancelled"
|
||||
name="cancelled"
|
||||
domain="[('state', '=', 'cancelled')]"
|
||||
name="cancel"
|
||||
domain="[('state', '=', 'cancel')]"
|
||||
/>
|
||||
<filter
|
||||
string="On Board"
|
||||
|
||||
@@ -342,7 +342,7 @@ class ReservationLinesToSplit(models.TransientModel):
|
||||
reservation = line.reservation_wizard_id.reservation_id
|
||||
rooms_available = False
|
||||
if line.date and reservation:
|
||||
if reservation.overbooking or reservation.state in ("cancelled"):
|
||||
if reservation.overbooking or reservation.state in ("cancel"):
|
||||
line.allowed_room_ids = self.env["pms.room"].search(
|
||||
[("active", "=", True)]
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user