[IMP] reservation state cancel key, improvement views and refactoring

This commit is contained in:
Dario Lodeiros
2021-06-28 10:21:01 +02:00
parent c72be7c8b3
commit 3a4b48901d
14 changed files with 66 additions and 97 deletions

View File

@@ -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="&quot;pms/static/description/avatar.png&quot;"
/>
</t>
@@ -401,7 +401,7 @@
string="Future"
name="future"
domain="[('checkin', '&gt;=', 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">

View File

@@ -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"

View File

@@ -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"