mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
Merge branch '14.0-pms-checkin-flow' of https://github.com/commitsun/pms into 14.0-pms-checkin-flow
This commit is contained in:
@@ -160,6 +160,7 @@ class PmsCheckinPartner(models.Model):
|
||||
record.update(vals)
|
||||
if record.reservation_id.state == "confirm":
|
||||
record.reservation_id.state = "onboard"
|
||||
# keep the checkin reservations popup open to checkin reservation hosts
|
||||
if self._context.get("popup"):
|
||||
self.ensure_one()
|
||||
kanban_id = self.env.ref("pms.pms_checkin_partner_kanban_view").id
|
||||
@@ -178,12 +179,10 @@ class PmsCheckinPartner(models.Model):
|
||||
}
|
||||
|
||||
def action_done(self):
|
||||
for record in self:
|
||||
if record.state == "onboard":
|
||||
hour = record._get_departure_hour()
|
||||
vals = {
|
||||
"state": "done",
|
||||
"departure_hour": hour,
|
||||
}
|
||||
record.update(vals)
|
||||
for record in self.filtered(lambda c: c.state == "onboard"):
|
||||
vals = {
|
||||
"state": "done",
|
||||
"arrival": fields.Datetime.now(),
|
||||
}
|
||||
record.update(vals)
|
||||
return True
|
||||
|
||||
@@ -1308,7 +1308,7 @@ class PmsReservation(models.Model):
|
||||
"edit": True,
|
||||
"popup": True,
|
||||
},
|
||||
"domain": [("reservation_id", "=", self.id), ("state", "=", "precheckin")],
|
||||
"domain": [("reservation_id", "=", self.id)],
|
||||
"target": "new",
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,9 @@
|
||||
<field name="model">pms.checkin.partner</field>
|
||||
<field name="arch" type="xml">
|
||||
<form create="false">
|
||||
<header>
|
||||
<field name="state" widget="statusbar" />
|
||||
</header>
|
||||
<sheet>
|
||||
<group name="group_top">
|
||||
<group name="group_left">
|
||||
@@ -35,7 +38,6 @@
|
||||
<field name="reservation_id" />
|
||||
<field name="folio_id" />
|
||||
<field name="identifier" />
|
||||
<field name="state" />
|
||||
</group>
|
||||
</group>
|
||||
</sheet>
|
||||
@@ -161,50 +163,12 @@
|
||||
<div class="o_kanban_record_top">
|
||||
<div class="o_kanban_record_headings">
|
||||
<strong class="o_kanban_record_title">
|
||||
<div
|
||||
class="float-right"
|
||||
t-if="record.state.raw_value == 'onboard'"
|
||||
name="state"
|
||||
>
|
||||
<span
|
||||
class="fa fa-circle text-success"
|
||||
role="img"
|
||||
aria-label="Present"
|
||||
title="Present"
|
||||
<div class="float-right">
|
||||
<field
|
||||
name="state"
|
||||
>
|
||||
|
||||
</span>
|
||||
</div>
|
||||
<div
|
||||
class="float-right"
|
||||
t-if="record.state.raw_value == 'done'"
|
||||
name="state"
|
||||
>
|
||||
<span
|
||||
class="fa fa-circle text-muted"
|
||||
role="img"
|
||||
aria-label="Done"
|
||||
title="Done"
|
||||
name="state"
|
||||
>
|
||||
|
||||
</span>
|
||||
</div>
|
||||
<div
|
||||
class="float-right"
|
||||
t-if="record.state.raw_value == 'precheckin'"
|
||||
name="state"
|
||||
>
|
||||
<span
|
||||
class="fa fa-circle text-warning"
|
||||
role="img"
|
||||
aria-label="Precheckin"
|
||||
title="Precheckin"
|
||||
name="state"
|
||||
>
|
||||
|
||||
</span>
|
||||
widget="label_selection"
|
||||
options="{'classes': {'draft': 'default', 'precheckin': 'info', 'onboard': 'warning', 'onboard': 'success', 'done': 'secondary'}}"
|
||||
/>
|
||||
</div>
|
||||
<field
|
||||
name="name"
|
||||
|
||||
@@ -615,8 +615,10 @@
|
||||
name="state"
|
||||
decoration-success="state == 'onboard'"
|
||||
decoration-info="state == 'confirm'"
|
||||
decoration-primary="state == 'no_checkout'"
|
||||
decoration-danger="state == 'cancelled'"
|
||||
decoration-primary="state == 'draft'"
|
||||
decoration-bf="state == 'draft'"
|
||||
decoration-warning="state == 'no_show'"
|
||||
widget="badge"
|
||||
optional="show"
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user