[ADD] Pricelist cancelled rules

This commit is contained in:
Dario Lodeiros
2019-03-23 15:51:24 +01:00
parent 8af44c43cf
commit e73be563d2
11 changed files with 230 additions and 29 deletions

View File

@@ -0,0 +1,63 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!--==================================================== Cancelation Rules ==================================================== -->
<!-- Form view of cancelation rules -->
<record model="ir.ui.view" id="hotel_cancelation_rule_form">
<field name="name">hotel.cancelation.rule.form</field>
<field name="model">hotel.cancelation.rule</field>
<field name="arch" type="xml">
<form string="Cancelation Rules">
<sheet>
<h3>
<field name="name" />
<separator />
<label for="name" string="Max. days InTime before Checkin" />
<field name="days_intime" />
</h3>
<group>
<group string="Late">
<field name="penalty_late" />
<field name="apply_on_late" />
<field name="days_late" attrs="{'invisible': [('apply_on_late','not in',('days'))]}" />
</group>
<group string="No Show">
<field name="penalty_noshow" />
<field name="apply_on_noshow" />
<field name="days_noshow" attrs="{'invisible': [('apply_on_noshow','not in',('days'))]}" />
</group>
</group>
</sheet>
</form>
</field>
</record>
<!-- Tree view of cancelation rules -->
<record model="ir.ui.view" id="hotel_cancelation_rule_view_tree">
<field name="name">hotel.cancelation.rule.tree</field>
<field name="model">hotel.cancelation.rule</field>
<field name="arch" type="xml">
<tree string="Cancelation Rules">
<field name="name" />
<field name="days_intime" />
<field name="penalty_late" />
<field name="apply_on_late" />
<field name="penalty_noshow" />
<field name="apply_on_noshow" />
</tree>
</field>
</record>
<!-- Action of hotel cancelation rules -->
<record model="ir.actions.act_window" id="action_hotel_cancelation_rule">
<field name="name">Cancelation Rules</field>
<field name="res_model">hotel.cancelation.rule</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
</record>
<menuitem name="Cancelation Rules" id="menu_hotel_cancelation_rule"
action="action_hotel_cancelation_rule" sequence="25"
parent="hotel.configuration_others" />
</odoo>

View File

@@ -34,7 +34,7 @@
<!-- 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"/>
statusbar_visible="draft,sent,sale,done" />
</header>
<sheet>

View File

@@ -16,7 +16,7 @@
<field name="model">hotel.reservation</field>
<field name="priority">20</field>
<field name="arch" type="xml">
<form string="Reservation" >
<form string="Reservation">
<header>
<field name="splitted" invisible="True" />
<field name="tax_ids" invisible="1"/>
@@ -61,21 +61,21 @@
attrs="{'invisible':[('splitted', '=', False)]}"
/>
<button name="open_master" string="Open Master" type="object" class="oe_highlight" icon="fa-file" attrs="{'invisible':['|',['parent_reservation', '=', False]]}" />
<field name="state" widget="statusbar"/>
<field name="state" select="2" widget="statusbar" statusbar_visible="draft,confirm,booking,done" />
</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>
<field name="shared_folio" invisible="1"/>
<sheet>
<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>
<field name="shared_folio" invisible="1"/>
<div class="oe_button_box" attrs="{'invisible': [('folio_id','=',False)]}">
<button type="object" class="oe_stat_button"
icon="fa-file"
@@ -196,6 +196,7 @@
<field name="departure_hour"/>
</group>
<group colspan="4" string="Reservation Details" name="reservation_details">
<field name="cancelled_reason" attrs="{'invisible': [('state', 'not in', ('cancelled'))]}"/>
<field name="nights"/>
<!-- TODO: How to filter to avoid show False (generic) pricelist board when exist a specific pricelist board¿? -->
<field name="board_service_room_id" domain="[
@@ -287,6 +288,8 @@
<field name="date" />
<field name="price" />
<field name="discount" />
<field name="cancel_discount"
attrs="{'column_invisible': [('parent.state','!=','cancelled')]}" />
</tree>
</field>
</page>

View File

@@ -0,0 +1,17 @@
<?xml version="1.0"?>
<odoo>
<record id="product_pricelist_view_form" model="ir.ui.view">
<field name="model">product.pricelist</field>
<field name="inherit_id" ref="product.product_pricelist_view" />
<field name="arch" type="xml">
<xpath expr="//field[@name='country_group_ids']" position="before">
<field name="pricelist_type" />
<field name="cancelation_rule_id" />
</xpath>
</field>
</record>
</odoo>