Files
pms/pms/views/pms_folio_views.xml
Miguel Padin bd49db24f0 [DONE] pms: allow to select the rules to be overridden (#67)
* [IMP] pms: allow to select the rules to be overridden

* [FIX] pms: fix pricelist bug last commit
2021-03-20 10:06:32 +01:00

557 lines
27 KiB
XML

<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record model="ir.ui.view" id="pms_folio_view_form">
<field name="name">pms.folio.form</field>
<field name="model">pms.folio</field>
<field name="arch" type="xml">
<form string="Folio">
<header>
<button
name="action_confirm"
states="draft"
string="Confirm Sale"
class="btn-primary"
type="object"
/>
<button
name="action_cancel"
string="Cancel Folio"
attrs="{'invisible': [('state', 'not in', ('confirm','draft'))]}"
type="object"
/>
<button
name="action_done"
type="object"
string="Set to Done"
help="If a Folio is done, you cannot modify it manually anymore. However, you will still be able to invoice. This is used to freeze the Folio."
/>
<button
name="%(pms.action_view_folio_advance_payment_inv)d"
string="Create Invoice"
type="action"
class="btn-primary"
attrs="{'invisible': [('invoice_status', '!=', 'to invoice')]}"
/>
<field
name="state"
select="2"
widget="statusbar"
statusbar_visible="draft,sent,sale,done"
/>
</header>
<sheet>
<div class="oe_button_box" name="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="arrive_smart_button"
icon="fa-street-view"
name="action_to_arrive"
>
<div class="o_form_field o_stat_info">
<span class="o_stat_value">
<field
name="count_rooms_pending_arrival"
nolabel="1"
/>
</span>
<span class="o_stat_text">To arrive Rooms</span>
</div>
</button>
<button
type="object"
class="oe_stat_button"
name="action_checks"
>
<field
name="ratio_checkin_data"
string="Checkin Data"
widget="percentpie"
/>
</button>
<button
name="action_view_invoice"
type="object"
class="oe_stat_button"
icon="fa-pencil-square-o"
attrs="{'invisible': [('invoice_count', '=', 0)]}"
>
<field
name="invoice_count"
widget="statinfo"
string="Invoices"
/>
</button>
<button
name="folio_multi_changes"
type="object"
class="oe_stat_button"
icon="fa-calculator"
>
<span class="o_stat_text">Change Prices</span>
</button>
</div>
<widget
name="web_ribbon"
title="Paid"
attrs="{'invisible': [('payment_state', '!=', 'paid')]}"
/>
<widget
name="web_ribbon"
title="Partial"
bg_color="bg-warning"
attrs="{'invisible': [('payment_state', '!=', 'partial')]}"
/>
<h2>
<field name="name" />
</h2>
<h1>
<field
name="partner_id"
placeholder="Guest"
attrs="{'invisible':[('reservation_type','in',('out'))]}"
/>
<field
name="closure_reason_id"
placeholder="Closure reason"
attrs="{'invisible':[('reservation_type','not in',('out'))]}"
/>
</h1>
<group col="8">
<group
colspan="2"
col="3"
string="General Info"
name="contact_details"
>
<field name="email" placeholder="email" />
<field name="mobile" placeholder="mobile" />
<field name="phone" />
<field name="partner_internal_comment" />
<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'))]}"
/>
<field name="internal_comment" />
</group>
<group
colspan="2"
col="3"
string="Sale Details"
name="sale_details"
>
<field name="pms_property_id" invisible="0" />
<field name="pricelist_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="agency_id" />
<field
name="channel_type_id"
attrs="{'readonly':[('agency_id','!=', False)]}"
/>
<field name="internal_comment" />
</group>
<group
class="oe_subtotal_footer oe_right"
colspan="2"
name="folio_total"
>
<field
name="amount_untaxed"
widget="monetary"
options="{'currency_field': 'currency_id'}"
/>
<field
name="amount_tax"
widget="monetary"
options="{'currency_field': 'currency_id'}"
/>
<div
class="oe_subtotal_footer_separator oe_inline o_td_label"
>
<label for="amount_total" />
</div>
<field
name="amount_total"
nolabel="1"
class="oe_subtotal_footer_separator"
widget="monetary"
options="{'currency_field': 'currency_id'}"
/>
<field
name="commission"
widget='monetary'
options="{'currency_field': 'currency_id'}"
/>
</group>
<div class="oe_clear" />
</group>
<group invisible="1">
<field name="payment_state" invisible="1" force_save="1" />
<field name="move_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" />
<field name="number_of_rooms" invisible="1" />
</group>
<notebook colspan="4" col="1">
<page string="Sale Lines">
<field
name="sale_line_ids"
widget="section_and_note_one2many"
>
<tree string="Sales Lines" editable="bottom">
<control>
<create
name="add_product_control"
string="Add a product"
/>
<create
name="add_section_control"
string="Add a section"
context="{'default_display_type': 'line_section'}"
/>
<create
name="add_note_control"
string="Add a note"
context="{'default_display_type': 'line_note'}"
/>
</control>
<field name="sequence" widget="handle" />
<!-- We do not display the type because we don't want the user to be bothered with that information if he has no section or note. -->
<field name="display_type" invisible="1" />
<!-- <field name="product_updatable" invisible="1"/> -->
<field
name="product_id"
options="{'no_open': True}"
force_save="1"
/>
<field
name="name"
widget="section_and_note_text"
optional="show"
/>
<field
name="analytic_tag_ids"
optional="hide"
groups="analytic.group_analytic_tags"
widget="many2many_tags"
options="{'color_field': 'color'}"
domain="['|', ('company_id', '=', False), ('company_id', '=', parent.company_id)]"
/>
<field
name="product_uom_qty"
decoration-info="(not display_type and invoice_status == 'to invoice')"
decoration-bf="(not display_type and invoice_status == 'to invoice')"
context="{
'partner_id': parent.partner_id,
'quantity': product_uom_qty,
'pricelist': parent.pricelist_id,
'uom': product_uom,
'company_id': parent.company_id
}"
/>
<field
name="qty_invoiced"
decoration-info="(not display_type and invoice_status == 'to invoice')"
decoration-bf="(not display_type and invoice_status == 'to invoice')"
string="Invoiced"
attrs="{'column_invisible': [('parent.state', '=', 'draft')]}"
optional="show"
/>
<field name="qty_to_invoice" invisible="1" />
<field name="product_uom_readonly" invisible="1" />
<field name="reservation_line_ids" invisible="1" />
<field
name="product_uom"
force_save="1"
string="UoM"
groups="uom.group_uom"
options='{"no_open": True}'
optional="show"
/>
<field name="price_unit" />
<field
name="tax_ids"
widget="many2many_tags"
options="{'no_create': True}"
domain="[('type_tax_use','=','sale'),('company_id','=',parent.company_id)]"
optional="show"
/>
<field
name="discount"
string="Disc.%"
groups="product.group_discount_per_so_line"
optional="show"
widget="product_discount"
/>
<field
name="price_subtotal"
widget="monetary"
groups="account.group_show_line_subtotals_tax_excluded"
/>
<field
name="price_total"
widget="monetary"
groups="account.group_show_line_subtotals_tax_included"
/>
<field name="state" invisible="1" />
<field name="invoice_status" invisible="1" />
<field name="currency_id" invisible="1" />
<field name="price_tax" invisible="1" />
<field name="company_id" invisible="1" />
</tree>
</field>
</page>
<page string="Reservation Rooms">
<field
name="reservation_ids"
colspan="4"
string="Room Line"
nolabel="1"
context="{'reservation_ids':reservation_ids,'folio_id': id,'tree_view_ref':'pms.pms_reservation_view_bottom_tree', 'form_view_ref':'pms.pms_reservation_view_form'}"
/>
</page>
<page string="Services">
<separator string="Service Lines" colspan="4" />
<field
name="service_ids"
context="{'folio_id': id,'tree_view_ref':'pms.pms_service_view_tree', 'form_view_ref':'pms.pms_service_view_form'}"
nolabel="1"
/>
</page>
<!--TODO: Add precheckin with indeterminate select room?? -->
<page name="persons" string="Rooming">
<field
name="checkin_partner_ids"
context="{
'default_folio_id': id,
'folio_id': id,
'tree_view_ref':'pms.pms_checkin_partner_folio_view_tree',
}"
/>
</page>
<page name="invoicing" string="Invoicing">
<div
class="alert alert-info"
role="alert"
style="margin-bottom:0px;"
>
these are the billing information associated with the
booking client or the company (if a company is
assigned). If you want to bill an independent contact,
you can select it in the billing assistant
</div>
<group>
<field
name="partner_invoice_ids"
string="Contact Invoiced"
/>
</group>
</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" />
<field name="activity_ids" />
<field name="message_ids" />
</div>
</form>
</field>
</record>
<record model="ir.ui.view" id="pms_folio_view_tree">
<field name="name">pms.folio.tree</field>
<field name="model">pms.folio</field>
<field name="arch" type="xml">
<tree
string="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="user_id" optional="show" widget="many2one_avatar_user" />
<field name="reservation_ids" widget="many2many_tags" />
<field name="amount_total" sum="Total amount" />
<field name="pending_amount" sum="Total debt" />
<field name="invoice_status" />
<field name="pms_property_id" invisible="0" />
</tree>
</field>
</record>
<!-- Folio Kanban View -->
<record model="ir.ui.view" id="pms_folio_view_kanban">
<field name="name">pms.folio.kanban</field>
<field name="model">pms.folio</field>
<field name="arch" type="xml">
<kanban class="o_res_partner_kanban" limit="80">
<field name="name" />
<field name="partner_id" />
<field name="reservation_ids" />
<field name="service_ids" />
<field name="pending_amount" />
<!-- <field name="refund_amount" /> -->
<field name="invoices_paid" />
<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>
<div class="oe_kanban_partner_links" />
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<record model="ir.ui.view" id="pms_folio_view_search">
<field name="name">pms.folio.search</field>
<field name="model">pms.folio</field>
<field name="arch" type="xml">
<search string="Tables Detail">
<field name="partner_id" />
<field name="partner_invoice_ids" />
<field name="agency_id" />
<filter
name="to_invoice"
string="To invoice"
domain="[('invoice_status', '=', 'to invoice')]"
/>
<filter
name="payment_pending"
string="Payment Pending"
domain="[('pending_amount', '&gt;', 0)]"
/>
<group expand="0" string="Group By">
<filter
string="Customer"
icon="terp-stock_symbol-selection"
name="group_customer"
context="{'group_by':'partner_id'}"
/>
<filter
string="Invoice Contact"
name="group_invoice_contact"
context="{'group_by':'partner_invoice_ids'}"
/>
<filter
string="Tour Operator"
domain="[]"
name="group_agency"
context="{'group_by':'agency_id'}"
/>
</group>
</search>
</field>
</record>
<record id="pms_folio_view_graph" model="ir.ui.view">
<field name="name">view.pms.folio.graph</field>
<field name="model">pms.folio</field>
<field name="arch" type="xml">
<graph type="bar">
</graph>
</field>
</record>
<!-- Add create invoice merge folio -->
<!-- <act_window
name="Send Confirm Mail"
res_model="mail.compose.message"
binding_model="pms.folio"
view_mode="form"
target="new"
id="action_view_folio_send_confirm_mail"
context="{
'default_model': 'pms.folio',
'default_res_id': active_id,
'default_use_template': True,
'default_template_id': ref('pms.email_template_reservation'),
'default_composition_mode': 'comment',
'force_send': True,
'mark_so_as_sent': True,
}"
/> -->
<record model="ir.actions.act_window" id="open_pms_folio1_form_tree_all">
<field name="name">Folio</field>
<field name="res_model">pms.folio</field>
<field name="view_mode">tree,form,graph</field>
</record>
<menuitem
name="Folios"
id="pms_folio_menu"
action="open_pms_folio1_form_tree_all"
sequence="5"
parent="pms_sales_menu"
/>
</odoo>