Files
pms/hotel/views/hotel_folio_views.xml
2019-03-14 00:04:44 +01:00

336 lines
19 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!--=== Hotel Folio ==== -->
<!-- Form view of hotel folio -->
<record model="ir.ui.view" id="hotel_folio_view_form">
<field name="name">hotel.folio.form</field>
<field name="model">hotel.folio</field>
<field name="arch" type="xml">
<form string="Folio">
<header>
<!-- <field name="has_confirmed_reservations_to_send" invisible="1" /> -->
<!-- <field name="has_cancelled_reservations_to_send" invisible="1" /> -->
<!-- <field name="has_checkout_to_send" invisible="1" /> -->
<button name="action_confirm" states="draft" string="Confirm Sale"
class="btn-primary" type="object" />
<!-- <button name="send_reservation_mail" type="object" string="Send Confirmation Email"
attrs="{'invisible': [('has_confirmed_reservations_to_send', '=', False)]}" class="oe_highlight"/> -->
<!-- <button name="send_cancel_mail" type="object" string="Send Cancel Email"
attrs="{'invisible': [('has_cancelled_reservations_to_send', '=', False)]}" class="oe_highlight"/> -->
<!-- <button name="send_exit_mail" type="object" string="Send Exit Email"
attrs="{'invisible': [('has_checkout_to_send', '=', False)]}" class="oe_highlight"/> -->
<button name="%(hotel.action_view_folio_advance_payment_inv)d"
string="Create Invoice" type="action" class="btn-primary" states="sale"
attrs="{'invisible': [('state', '!=', 'confirm')]}"/>
<!-- <button name="action_cancel_draft" states="cancel,sale" string="Set to Draft"
type="object" icon="fa-undo" class="oe_highlight" /> -->
<button name="action_cancel" string="Cancel Folio" states="sale"
type="object" icon="fa-minus-square" class="oe_highlight" />
<button name="action_cancel" string="Cancel Folio" states="draft"
icon="fa-minus-square" type="object" class="oe_highlight" />
<button name="action_done" type="object" string="Set to Done"
help="If a Hotel Folio is done, you cannot modify it manually anymore. However, you will still be able to invoice or deliver. This is used to freeze the Hotel Folio." />
<!-- states="sale" attrs="{'invisible': [('invoice_status', '!=', 'invoiced')]}" -->
<!-- <button name="print_quotation" string="Print" type="object" states="sent,sale"/> -->
<field name="state" select="2" widget="statusbar"
statusbar_visible="draft,sent,sale,done" invisible="1"/>
</header>
<sheet>
<div class=" oe_button_box">
<button type="object" class="oe_stat_button"
id="payment_smart_button"
icon="fa-money"
name="action_pay"
attrs="{'invisible': ['|',('pending_amount','&lt;=',0)]}">
<div class="o_form_field o_stat_info">
<span class="o_stat_value">
<field name="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" id="invoice_button"
icon="fa-pencil-square-o" name="open_invoices_folio"
attrs="{'invisible': [('invoice_count', '=', 0)]}"
context="{'default_folio_id': active_id}">
<div class="o_form_field o_stat_info">
<span class="o_stat_value">
<field name="invoice_count"/>
</span>
<span class="o_stat_text">Invoices</span>
</div>
</button>
</div>
<!-- <field name="image" widget="image" class="oe_avatar" options="{&quot;preview_image&quot;: &quot;image_medium&quot;, &quot;size&quot;: [90, 90]}"/> -->
<h2><field name="name"/></h2>
<h1>
<field name="partner_id" default_focus="1" placeholder="Guest" attrs="{'invisible':[('reservation_type','in',('out'))]}"/>
<field name="closure_reason_id" placeholder="Closure reason" default_focus="1" attrs="{'invisible':[('reservation_type','not in',('out'))]}"/>
</h1>
<group>
<group>
<field name="email" placeholder="email"/>
<field name="mobile" placeholder="mobile"/>
<field name="phone" />
<field name="segmentation_ids" widget="many2many_tags" placeholder="Segmentation..."
options="{'no_create': True,'no_open': True}" />
<field name="cancelled_reason" attrs="{'invisible':[('state','not in',('cancel'))]}"/>
</group>
<group>
<field name="pricelist_id" />
<field name="company_id" />
<field name="company_id" options="{'no_create': True}" groups="base.group_multi_company"/>
<field name="reservation_type" attrs="{'readonly':[('state','not in',('draft'))]}"/>
<field name="channel_type" attrs="{'required':[('reservation_type','=','normal')]}"/>
</group>
<group>
<field name="partner_internal_comment"/>
</group>
<group>
<field name="internal_comment"/>
<field name="credit_card_details" attrs="{'invisible':[('pending_amount','&lt;=',0)]}"/>
</group>
<group colspan="2" class="oe_subtotal_footer oe_right">
<field name="amount_untaxed" sum="Untaxed amount" widget='monetary' />
<field name="amount_tax" widget='monetary' />
<div class="oe_subtotal_footer_separator oe_inline">
<label for="amount_total" />
</div>
<field name="amount_total" nolabel="1" sum="Total amount"
widget='monetary' />
</group>
<div class="oe_clear" />
<group>
<field name="note" />
</group>
</group>
<group invisible="1">
<field name="invoice_ids" invisible="1"/>
<field name="invoice_status" invisible="1" />
<field name="currency_id" invisible="1"/>
<field name="refund_amount" invisible="1" />
<field name="invoices_paid" invisible="1" />
</group>
<notebook colspan="4" col="1">
<page string="Reservation Rooms">
<field name="room_lines" colspan="4" string="Room Line"
nolabel="1" context="{'from_folio':True,'room_lines':room_lines,'folio_id': id,'tree_view_ref':'hotel.hotel_reservation_view_bottom_tree', 'form_view_ref':'hotel.hotel_reservation_view_form'}"/>
</page>
<page string="Services">
<separator string="Service Lines" colspan="4"/>
<field name="service_ids"
context="{'from_room':False,'folio_id': id,'tree_view_ref':'hotel.hotel_service_view_tree', 'form_view_ref':'hotel.hotel_service_view_form'}"
nolabel="1" />
</page>
<page name="persons" string="Persons">
<field name="checkin_partner_ids"
context="{
'default_reservation_id': id,
'reservation_id': id,
'tree_view_ref':'hotel.hotel_checkin_partner_reservation_view_tree',
}"
/>
</page>
<page name="invoicing" string="Invoicing">
<group>
<field name="partner_diff_invoicing" string="Bill to another Address"/>
</group>
<group>
<field name="partner_invoice_id"
string="Contact Invoiced"
attrs="{'invisible':[('partner_diff_invoicing','=',False)]}"/>
</group>
<group>
<group>
<field name="partner_invoice_vat" />
<field name="partner_invoice_email" />
</group>
<group>
<field name="partner_invoice_parent_id" />
<field name="partner_invoice_type" />
</group>
<group>
<label for="partner_invoice_street" string="Address"/>
<div class="o_address_format">
<field name="partner_invoice_street" placeholder="Street..." class="o_address_street"/>
<field name="partner_invoice_street2" placeholder="Street 2..." class="o_address_street"/>
<field name="partner_invoice_city" placeholder="City" class="o_address_city"/>
<field name="partner_invoice_state_id" class="o_address_state" placeholder="State" options='{"no_open": True}'/>
<field name="partner_invoice_zip" placeholder="ZIP" class="o_address_zip"/>
<field name="partner_invoice_country_id" placeholder="Country" class="o_address_country" options='{"no_open": True, "no_create": True}'/>
</div>
</group>
<group>
</group>
</group>
</page>
<page name="payments" string="Payments" attrs="{'invisible': [('invoices_paid','&lt;=',0)]}">
<field name="payment_ids"
options="{'no_create': True,'no_edit': True}" />
</page>
<page name="returns" string="Retun Payments" attrs="{'invisible': [('refund_amount','&lt;=',0)]}">
<field name="return_ids"
options="{'no_create': True,'no_edit': True}" />
</page>
<page string="Other data" invisible="1">
<group>
<field name="user_id" />
<field name="client_order_ref" />
</group>
</page>
<!-- <page string="Foreign Exchange" name="foreign exchange" invisible="1">
<separator string="Foreign Exchange" colspan="4" />
<field name="currrency_ids" colspan="4" nolabel="1">
<tree>
<field name="name" />
<field name="today_date" />
<field name="type" />
<field name="in_amount" />
<field name="input_curr" />
<field name="total" sum="Total Amount" />
<field name="out_curr" />
</tree>
</field>
</page> -->
</notebook>
</sheet>
<div class="oe_chatter">
<field name="message_follower_ids" widget="mail_followers"/>
<field name="activity_ids" widget="mail_activity"/>
<field name="message_ids" widget="mail_thread"/>
</div>
</form>
</field>
</record>
<!-- Tree view of hotel folio -->
<record model="ir.ui.view" id="hotel_folio_view_tree">
<field name="name">hotel.folio.tree</field>
<field name="model">hotel.folio</field>
<field name="arch" type="xml">
<tree string="Hotel Folio" decoration-info="state == 'draft'"
decoration-muted="state == 'cancel'"
default_order="create_date desc">
<field name="state"/>
<field name="name"/>
<field name="partner_id" select="1"/>
<field name="date_order" select="1"/>
<field name="room_lines" widget="many2many_tags" />
<field name="amount_total" sum="Total amount"/>
</tree>
</field>
</record>
<!-- Folio Kanban View -->
<record model="ir.ui.view" id="hotel_folio_view_kanban">
<field name="name">hotel.folio.kanban</field>
<field name="model">hotel.folio</field>
<field name="arch" type="xml">
<kanban class="o_res_partner_kanban" limit="80">
<field name="name"/>
<field name="partner_id"/>
<field name="room_lines"/>
<field name="service_ids"/>
<field name="pending_amount"/>
<field name="refund_amount"/>
<field name="invoices_paid"/>
<field name="booking_pending"/>
<field name="checkin_partner_count"/>
<field name="checkin_partner_pending_count"/>
<field name="partner_internal_comment"/>
<field name="cancelled_reason"/>
<field name="prepaid_warning_days"/>
<field name="date_order"/>
<templates>
<t t-name="kanban-box">
<div class="oe_kanban_global_click o_res_partner_kanban">
<div class="o_kanban_tags_section oe_kanban_partner_categories"/>
<div class="oe_kanban_details">
<strong class="oe_partner_heading"><field name="partner_id"/></strong>
<ul>
<li t-if="record.name.raw_value"><field name="name"/></li>
<span t-if="record.checkin_partner_count.value&gt;0" class="badge"><i class="fa fa-fw fa-bed"/><t t-esc="record.checkin_partner_count.value"/></span>
<span t-if="record.checkin_partner_pending_count.value&gt;0" class="badge"><i class="fa fa-fw fa-user-plus"/><t t-esc="record.checkin_partner_pending_count.value"/></span>
</ul>
<div class="oe_kanban_partner_links"/>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<!-- Search view of hotel folio -->
<record model="ir.ui.view" id="hotel_folio_view_search">
<field name="name">hotel.folio.search</field>
<field name="model">hotel.folio</field>
<field name="arch" type="xml">
<search string="Tables Detail">
<field name="partner_id" />
<group expand="0" string="Group By">
<filter string="Customer" icon="terp-stock_symbol-selection"
context="{'group_by':'partner_id'}" />
</group>
</search>
</field>
</record>
<!--graph view of hotel folio -->
<record id="hotel_folio_view_graph" model="ir.ui.view">
<field name="name">view.hotel.folio.graph</field>
<field name="model">hotel.folio</field>
<field name="arch" type="xml">
<graph type="bar">
</graph>
</field>
</record>
<!-- Add create invoice merge folio -->
<act_window id="action_view_folio_advance_payment_inv"
name="Invoice Folio"
src_model="hotel.folio"
res_model="folio.advance.payment.inv"
key2="client_action_multi" target="new"
view_mode="form" multi="True"/>
<act_window name="Send Confirm Mail"
res_model="mail.compose.message"
src_model="hotel.folio"
view_mode="form"
multi="False"
view_type="form"
target="new"
key2="client_action_multi"
id="action_view_folio_send_confirm_mail"
context="{
'default_model': 'hotel.folio',
'default_res_id': active_id,
'default_use_template': True,
'default_template_id': ref('hotel.mail_template_hotel_reservation'),
'default_composition_mode': 'comment',
'force_send': True,
'mark_so_as_sent': True,
}" />
<!-- Action for hotel folio -->
<record model="ir.actions.act_window" id="open_hotel_folio1_form_tree_all">
<field name="name">Hotel Folio</field>
<field name="res_model">hotel.folio</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form,graph</field>
</record>
<menuitem id="menu_all_folio" name="Reservations"
parent="hotel.hotel_management_menu" sequence="4"/>
<menuitem name="Folios" id="menu_open_hotel_folio1_form_tree_all"
action="open_hotel_folio1_form_tree_all" sequence="15" parent="menu_all_folio" />
</odoo>