Files
pms/pms/views/pms_reservation_views.xml
2020-10-16 14:30:48 +02:00

866 lines
41 KiB
XML

<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record model="ir.actions.act_window" id="open_pms_reservation_form_tree_all">
<field name="name">Reservation</field>
<field name="res_model">pms.reservation</field>
<field name="view_mode">tree,form,graph,pivot</field>
</record>
<record model="ir.ui.view" id="pms_reservation_view_form">
<field name="name">pms.reservation.form</field>
<field name="model">pms.reservation</field>
<field name="priority">20</field>
<field name="arch" type="xml">
<form string="Reservation">
<header>
<field name="splitted" invisible="True" />
<field name="tax_ids" invisible="1" />
<field name="checkin_partner_count" invisible="1" />
<button
name="confirm"
string="Confirm"
class="oe_highlight"
type="object"
attrs="{'invisible':[('state','not in',('draft','cancelled'))]}"
/>
<button
name="action_cancel"
string="Cancel Reservation"
type="object"
attrs="{'invisible':['|',('folio_id', '=', False),('state','not in',('confirm','onboard'))]}"
/>
<button
name="action_reservation_checkout"
string="Done"
states="onboard"
type="object"
/>
<button
name="draft"
string="Set to Draft"
states="cancelled"
class="oe_highlight"
type="object"
/>
<field
name="state"
widget="statusbar"
/>
</header>
<div
class="alert alert-info"
role="alert"
style="margin-bottom:0px;"
attrs="{'invisible': ['|',('shared_folio','=',False),('splitted', '=', True)]}"
>
This reservation has other reservantions and/or services in the folio, you can check it in the
<bold>
<button
class="alert-link"
type="object"
name="open_folio"
string="Folio Form"
/>
</bold>
</div>
<div
class="alert alert-warning"
role="alert"
style="margin-bottom:0px;"
attrs="{'invisible': [('splitted','=',False)]}"
>
This reservation is part of splitted reservation!, you can check it in the
<bold>
<button
class="alert-link"
type="object"
name="open_folio"
string="Folio Form"
/>
</bold>
</div>
<sheet>
<field name="shared_folio" invisible="1" />
<div
class="oe_button_box"
name="button_box"
attrs="{'invisible': [('folio_id','=',False)]}"
>
<button
type="object"
class="oe_stat_button"
icon="fa-file"
name="open_folio"
>
<div class="o_field_widget o_stat_info">
<span class="o_stat_text">
<field name="folio_id" readonly="1" nolabel="1" />
</span>
</div>
</button>
<button
type="action"
class="oe_stat_button"
icon="fa-list-ul"
attrs="{'invisible': ['|', ('partner_id','=',False), ('reservation_type','in',('out'))]}"
name="%(open_pms_reservation_form_tree_all)d"
context="{'search_default_partner_id': partner_id}"
>
<div class="o_field_widget o_stat_info">
<span class="o_stat_text">Books</span>
</div>
</button>
<button
type="object"
class="oe_stat_button"
id="payment_smart_button"
icon="fa-money"
name="action_pay_folio"
attrs="{'invisible': [('folio_pending_amount','&lt;=',0)]}"
>
<div class="o_field_widget o_stat_info">
<span class="o_stat_value">
<field
name="folio_pending_amount"
nolabel="1"
widget="monetary"
options="{'currency_field': 'currency_id'}"
/>
</span>
<span class="o_stat_text">Pending Payment</span>
</div>
</button>
<button
type="object"
class="oe_stat_button"
icon="fa-users"
name="action_checks"
attrs="{'invisible': [('checkin_partner_pending_count','&lt;=',0)]}"
>
<div class="o_form_field o_stat_info">
<span class="o_stat_value">
<field
name="checkin_partner_pending_count"
widget="statinfo"
nolabel="1"
/>
</span>
<span class="o_stat_text">Pending Checks</span>
</div>
</button>
</div>
<span
class="label label-danger"
attrs="{'invisible': [('state', 'not in', ('cancelled'))]}"
>Cancelled Reservation!</span>
<span
class="label label-warning"
attrs="{'invisible': [('overbooking', '=', False)]}"
>OverBooking!</span>
<h1>
<field
name="room_id"
select="1"
nolabel="1"
options="{'no_create': True,'no_open': True}"
placeholder="Room"
style="margin-right: 30px;"
required='1'
/>
<field
name="partner_id"
default_focus="1"
placeholder="Lastname, Firstname"
attrs="{'invisible':[('reservation_type','in',('out'))]}"
required="1"
/>
<field
name="closure_reason_id"
default_focus="1"
options="{'no_create': True,'no_open': True}"
placeholder="Closure Reason"
attrs="{'invisible':[('reservation_type','not in',('out'))]}"
/>
</h1>
<h3>
<group>
<div class="o_row">
<field
name="checkin"
widget="daterange"
nolabel="1"
class="oe_inline"
options="{'related_end_date': 'checkout'}"
/>
<i
class="fa fa-long-arrow-right mx-2"
aria-label="Arrow icon"
title="Arrow"
/>
<field
name="checkout"
widget="daterange"
nolabel="1"
class="oe_inline"
options="{'related_start_date': 'checkin'}"
/>
</div>
</group>
</h3>
<field
name="out_service_description"
placeholder="Out service description"
attrs="{'invisible':[('reservation_type','not in',('out'))]}"
/>
<group col="8">
<group
colspan="2"
col="3"
string="General Info"
name="contact_details"
>
<field
name="email"
colspan="2"
nolabel="1"
placeholder="email"
widget="email"
force_save="1"
attrs="{'invisible': [('reservation_type','in',('out'))],
'readonly': [('partner_id', '!=', False),
('email','!=', False)]}"
/>
<field
name="mobile"
colspan="2"
nolabel="1"
placeholder="mobile"
widget="phone"
force_save="1"
attrs="{'invisible': [('reservation_type','in',('out'))],
'readonly': [('partner_id', '!=', False),
('mobile','!=', False)]}"
/>
<field
name="phone"
colspan="2"
nolabel="1"
placeholder="phone"
widget="phone"
force_save="1"
attrs="{'invisible': [('reservation_type','in',('out'))],
'required': [('channel_type','in',('door','mail','phone')),
('mobile','=','')],
'readonly': [('partner_id', '!=', False),
('phone','!=', False)]}"
/>
<field
placeholder="Partner Notes"
colspan="2"
nolabel="1"
name="partner_internal_comment"
string="Partner Note"
attrs="{'invisible': [('reservation_type','in',('out'))]}"
/>
<field
nolabel="1"
colspan="2"
placeholder="Description in Guest Documents"
name="name"
/>
<field name="nights" />
<field placeholder="Arrival Hour" name="arrival_hour" />
<field placeholder="Departure Hour" name="departure_hour" />
</group>
<group
colspan="2"
col="3"
string="Reservation Details"
name="reservation_details"
>
<field name="pms_property_id" />
<field
name="pricelist_id"
attrs="{'invisible': [('reservation_type','in',('out'))]}"
/>
<field
name="agency_id"
options="{'no_create': True,'no_open': True}"
/>
<field
name="cancelled_reason"
attrs="{'invisible': [('state', 'not in', ('cancelled'))]}"
/>
<field
name="adults"
attrs="{'invisible': [('reservation_type','in',('out'))]}"
/>
<field
name="children"
attrs="{'invisible': [('reservation_type','in',('out'))]}"
/>
<field name="qty_invoiced" invisible="1" />
<field name="qty_to_invoice" invisible="1" />
<field name="allowed_room_ids" invisible="1" />
<field
name="room_type_id"
on_change="1"
options="{'no_create': True,'no_open': True}"
attrs="{'readonly':[('state','not in',('draft'))]}"
/>
<!-- TODO: How to filter to avoid show False (generic) pricelist board when exist a specific pricelist board¿? -->
<field
name="board_service_room_id"
domain="[
('pms_room_type_id', '=', room_type_id),
('pricelist_id', 'in', [pricelist_id, False])]"
options="{'no_create': True,'no_open': True}"
attrs="{'invisible': [('reservation_type','in',('out'))]}"
/>
<field
name="folio_internal_comment"
colspan="2"
nolabel="1"
placeholder="Reservation Notes"
/>
</group>
<group
colspan="2"
col="3"
class="oe_subtotal_footer"
style="margin-right: 20px; !important"
name="reservation_total"
string="Amounts"
>
<div
class="oe_subtotal_footer_separator oe_inline o_td_label"
>
<label
for="price_room_services_set"
string="Reservation Total"
/>
</div>
<field
name="price_room_services_set"
nolabel="1"
class="oe_subtotal_footer_separator"
widget="monetary"
/>
<field
name="discount"
string="Discount Room"
widget="monetary"
/>
<field name="price_subtotal" invisible="1" />
<field
name="price_services"
string="Only Services"
widget="monetary"
/>
<field
name="price_total"
string="Only Room"
widget="monetary"
/>
<field name="invoice_status" invisible="1" />
<field name="currency_id" invisible="1" />
<field
name="preconfirm"
attrs="{'invisible':[('folio_id', '!=', False)]}"
/>
<field
name="credit_card_details"
nolabel="1"
placeholder="Credit Card Details"
colspan="2"
attrs="{'invisible':[('folio_id','!=',False),('folio_pending_amount','&lt;=',0)]}"
/>
</group>
</group>
<group invisible="1">
<field
name="company_id"
options="{'no_create': True}"
groups="base.group_multi_company"
/>
<field name="pms_property_id" invisible="1" />
<!-- <field name="check_rooms" invisible="1"/> -->
<field name="checkin_partner_pending_count" invisible="1" />
<!-- <field name="product_uom" string="Rent(UOM)" invisible="1" /> -->
</group>
<notebook>
<page name="detail" string="Detail">
<field name="reservation_line_ids" nolabel="1">
<tree create="false" delete="false" editable="bottom">
<field name="room_id" />
<field name="date" readonly="1" force_save="1" />
<field name="price" />
<field name="discount" />
<field
name="cancel_discount"
attrs="{'column_invisible': [('parent.state','!=','cancelled')]}"
/>
</tree>
</field>
<group string="Services" name="reservation_services">
<field
name="service_ids"
context="{'default_reservation_id': active_id, 'default_folio_id': folio_id, 'form_view_ref':'pms.pms_service_view_form'}"
nolabel="1"
>
<!-- If charge this view with tree_view_ref, its !crash! (field not found) when open reservation form from folio form... ¿?-->
<tree
string="Services"
editable="bottom"
decoration-success="is_board_service == True"
>
<field name="is_board_service" invisible="1" />
<field name="company_id" invisible="0" />
<field name="pms_property_id" invisible="0" />
<button
type="object"
class="oe_stat_button"
icon="fa-1x fa-bed"
name="open_service_ids"
attrs="{'invisible':[('is_board_service','=', False)]}"
/>
<field
name="per_day"
invisible="1"
readonly="1"
/>
<field name="folio_id" invisible="1" />
<field
name="reservation_id"
invisible="1"
attrs="{'required': [('per_day','=',True)]}"
/>
<field
name="product_id"
domain="[('sale_ok', '=', True)]"
options="{'no_create': True,'no_open': True}"
/>
<field name="name" />
<field
name="product_qty"
attrs="{'readonly': [('per_day','=',True)]}"
force_save="1"
/>
<button
type="object"
class="oe_stat_button"
icon="fa-2x fa-bars"
name="open_service_ids"
attrs="{'invisible': [('per_day','=',False)]}"
/>
<field name="price_unit" />
<field name="discount" />
<field name="tax_ids" widget="many2many_tags" />
<field name="price_subtotal" />
<field name="price_tax" />
<field name="price_total" />
<field name="service_line_ids" invisible="1">
<tree string="Days">
<field name="date" />
<field name="day_qty" />
</tree>
</field>
</tree>
</field>
</group>
</page>
<page
name="persons"
string="Persons"
attrs="{'invisible': [('reservation_type','in',('out'))]}"
>
<group colspan="2" cols="6">
<field
name="segmentation_ids"
widget="many2many_tags"
placeholder="Segmentation..."
options="{'no_create': True,'no_open': True}"
/>
</group>
<field
name="checkin_partner_ids"
context="{
'checkin_partner_ids': checkin_partner_ids,
'default_reservation_id': id,
'reservation_id': id,
'tree_view_ref':'pms.pms_checkin_partner_reservation_view_tree',
}"
/>
</page>
<page
name="invoicing"
string="Invoicing"
attrs="{'invisible': [('reservation_type','in',('out'))]}"
>
<group>
<field
name="partner_invoice_id"
string="Contact Invoiced"
/>
</group>
</page>
<page name="others" string="Others">
<group>
<field name="localizator" />
<field name="overbooking" />
</group>
<group>
<field
name="channel_type"
attrs="{'required':[('reservation_type','not in',('staff','out'))]}"
/>
<field name="reservation_type" />
</group>
</page>
</notebook>
</sheet>
<div class="oe_chatter">
<field name="message_follower_ids" />
<field name="activity_ids" />
<field name="message_ids" />
</div>
</form>
</field>
</record>
<!-- Form view Checkin Partners from reservation -->
<record model="ir.ui.view" id="pms_reservation_checkin_view_form">
<field name="name">pms.reservation.checkin.form</field>
<field name="model">pms.reservation</field>
<field name="priority">100</field>
<field name="arch" type="xml">
<form string="Reservation">
<field name="reservation_type" invisible="1" />
<field name="splitted" invisible="1" />
<field name="state" invisible="1" />
<field name="overbooking" invisible="1" />
<field name="folio_id" invisible="1" />
<field name="adults" invisible="1" />
<field name="children" invisible="1" />
<div
class="alert alert-info"
role="alert"
style="margin-bottom:0px;"
attrs="{'invisible': ['|',('shared_folio','=',False),('splitted', '=', True)]}"
>
This reservation has other reservantions and/or services in the folio, you can check it in the
<bold>
<button
class="alert-link"
type="object"
name="open_folio"
string="Folio Form"
/>
</bold>
</div>
<field name="shared_folio" invisible="1" />
<field name="allowed_room_ids" invisible="1" />
<sheet>
<span
class="label label-danger"
attrs="{'invisible': [('state', 'not in', ('cancelled'))]}"
>Cancelled Reservation!</span>
<span
class="label label-warning"
attrs="{'invisible': [('overbooking', '=', False)]}"
>OverBooking!</span>
<h2>
<field
name="room_id"
readonly="1"
nolabel="1"
options="{'no_create': True,'no_open': True}"
style="margin-right: 30px;"
/>
<!-- <field
name="partner_id"
readonly="1"
options="{'no_open': True}"
/>
<span
class="fa-user"
style="margin-left:20px;"
attrs="{'invisible': [('reservation_type','not in',('normal'))]}"
/>
<span
class="fa-black-tie"
style="margin-left:20px; color: #C67;"
attrs="{'invisible': [('reservation_type','not in',('staff'))]}"
/> -->
<h3>
From <span class="fa-sign-in" style="margin: 5px;" />
<field
name="checkin"
style="margin-right: 10px;"
readonly="1"
/>
to
<span class="fa-sign-out" style="margin-right: 5px;" />
<field name="checkout" readonly="1" />
</h3>
</h2>
<group>
<field
name="segmentation_ids"
widget="many2many_tags"
placeholder="Segmentation..."
options="{'no_create': True,'no_open': True}"
/>
</group>
<field
name="checkin_partner_ids"
context="{
'default_reservation_id': id,
'reservation_id': id,
'tree_view_ref':'pms.pms_checkin_partner_reservation_view_tree',
}"
/>
</sheet>
</form>
</field>
</record>
<record model="ir.ui.view" id="pms_reservation_view_tree">
<field name="name">pms.reservation.tree</field>
<field name="model">pms.reservation</field>
<field name="arch" type="xml">
<tree
string="Reservation"
multi_edit="1" sample="1"
class="o_sale_order"
>
<field name="splitted" invisible="1" />
<field name="pricelist_id" invisible="1" />
<field name="room_id" options="{'no_create': True,'no_open': True}" />
<field name="checkin" widget="daterange" class="oe_inline" options="{'related_end_date': 'checkout'}"/>
<field name="checkout" widget="date" />
<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" />
<field name="room_type_id" invisible="1" />
<field name="adults" string="Persons" />
<field name="overbooking" invisible="1" />
<field name="activity_ids" widget="list_activity" optional="show"/>
<field name="create_uid" optional="show" widget="many2one_avatar_user"/>
<field name="origin" />
<field name="checkin_partner_ids" invisible="1" />
<field name="to_assign" invisible="1" />
<field name="checkin_partner_pending_count" invisible="1" />
<field name="tax_ids" invisible="1" />
<field name="price_subtotal" invisible="1" />
<field name="price_total" />
<field name="folio_pending_amount" string="Folio Pending Amount" />
<field name="company_id" />
<field name="state" decoration-success="state == 'done'" decoration-info="state == 'confirm'" widget="badge" optional="show"/>
</tree>
</field>
</record>
<!-- Tree editable BOTTOM view of reservation -->
<record model="ir.ui.view" id="pms_reservation_view_bottom_tree">
<field name="name">pms.reservation.tree</field>
<field name="model">pms.reservation</field>
<field name="inherit_id" ref="pms.pms_reservation_view_tree" />
<field name="mode">primary</field>
<field name="arch" type="xml">
<tree position="attributes">
<attribute name="editable">bottom</attribute>
<attribute name="delete">false</attribute>
<attribute name="string">Rooms</attribute>
</tree>
<xpath expr="//field[@name='state']" position="before">
<button
type="object"
class="oe_stat_button"
icon="fa-2x fa-suitcase"
name="open_reservation_form"
help="Open Reservation Room Detail"
/>
</xpath>
<xpath expr="//field[@name='folio_id']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<!-- <xpath expr="//button[@name='open_folio'][1]" position="attributes">
<attribute name="invisible">True</attribute>
</xpath>
<xpath expr="//button[@name='open_folio'][2]" position="attributes">
<attribute name="invisible">True</attribute>
</xpath>
<xpath
expr="//button[@name='%(open_pms_reservation_form_tree_all)d']"
position="attributes"
>
<attribute name="invisible">True</attribute>
</xpath> -->
<xpath expr="//field[@name='partner_id']" position="attributes">
<attribute name="invisible">True</attribute>
</xpath>
<xpath expr="//field[@name='folio_pending_amount']" position="attributes">
<attribute name="invisible">True</attribute>
</xpath>
<xpath expr="//field[@name='create_uid']" position="attributes">
<attribute name="invisible">True</attribute>
</xpath>
</field>
</record>
<record model="ir.ui.view" id="pms_reservation_view_search">
<field name="name">pms.reservation.search</field>
<field name="model">pms.reservation</field>
<field name="arch" type="xml">
<search string="Reservation Detail">
<field name="partner_id" />
<field name="folio_id" />
<field name="agency_id" />
<filter
string="My Reservations"
name="my_reservations"
domain="[('create_uid', '=', uid)]"
/>
<filter
string="Cancelled"
name="cancelled"
domain="[('state', '=', 'cancelled')]"
/>
<filter
string="On Board"
name="on_board"
domain="[('state','in',['onboard'])]"
help="Current Booking"
/>
<filter
string="To enter"
name="to_enter"
domain="[('state', '=', 'confirm')]"
/>
<filter
string="Overbookings"
name="overbookings"
domain="[('overbooking', '=', 'True')]"
/>
<filter
string="Reservations to 7 days"
name="next_res_week"
domain="[('checkin', '&lt;', (context_today()+datetime.timedelta(days=7)).strftime('%Y-%m-%d')),
('state', '=', 'confirm')]"
help="Show all reservations for which date enter is before than 7 days"
/>
<filter
string="Reservations to 14 days"
name="next_res_2week"
domain="[('checkin', '&lt;', (context_today()+datetime.timedelta(days=14)).strftime('%Y-%m-%d')),
('state', '=', 'confirm')]"
help="Show all reservations for which date enter is before than 14 days"
/>
<filter
string="Reservations to 1 month"
name="next_res_week"
domain="[('checkin', '&lt;', (context_today()+datetime.timedelta(days=30)).strftime('%Y-%m-%d')),
('state', '=', 'confirm')]"
help="Show all reservations for which date enter is before than aprox. 1 month"
/>
<filter
string="To Assign"
name="to_assign"
domain="[('to_assign','=',True)]"
/>
<separator />
<filter
string="Web"
name="web"
domain="[('channel_type', '=', 'web')]"
/>
<filter
string="Door"
name="door"
domain="[('channel_type', '=', 'door')]"
/>
<filter
string="Mail"
name="mail"
domain="[('channel_type', '=', 'mail')]"
/>
<filter
string="Phone"
name="phone"
domain="[('channel_type', '=', 'phone')]"
/>
<separator />
<filter
string="Still to be paid"
name="still_to_be_paid"
domain="[('folio_id.pending_amount','&gt;',0)]"
/>
<filter
string="Late Payment"
name="late_payment"
domain="[('folio_id.pending_amount','&gt;',0),('state','in',['done'])]"
/>
<filter
string="Lates and NoShows"
name="lates_and_noshows"
domain="[('cancelled_reason','in',['late','noshow'])]"
/>
<separator />
<filter
string="Staff"
name="staff"
domain="[('reservation_type','in',['staff'])]"
/>
<filter
string="Out of Service"
name="out_of_service"
domain="[('reservation_type','in',['dontsell'])]"
/>
<group expand="0" string="Group By">
<!-- <filter string="Room Type" domain="[]"
context="{'group_by':'room_type_id'}"/> -->
<filter
string="Room Type"
domain="[]"
name="room_type"
context="{'group_by':'room_type_id'}"
/>
<filter
string="Creation Date"
domain="[]"
name="creation_date"
context="{'group_by':'create_date'}"
/>
<filter
string="Checkin Date"
domain="[]"
name="checkin_date"
context="{'group_by':'checkin'}"
/>
<filter
string="Created By"
domain="[]"
name="created_by"
context="{'group_by':'create_uid'}"
/>
</group>
<searchpanel>
<field name="room_type_id" string="Room Type" enable_counters="1" />
<field name="pricelist_id" string="Pricelist" enable_counters="1"/>
<field name="state" string="State" enable_counters="1" select="multi" />
</searchpanel>
</search>
</field>
</record>
<menuitem
name="Reservation Rooms"
id="menu_open_pms_reservation_form_tree_all"
action="open_pms_reservation_form_tree_all"
sequence="10"
parent="menu_all_folio"
/>
</odoo>