|
|
<?xml version="1.0" encoding="utf-8"?> <odoo>
<record id="restaurant_table_booking_form" model="ir.ui.view"> <field name="name">Booking restaurant.table_booking form</field> <field name="model">restaurant.table_booking</field> <field name="arch" type="xml"> <form create="0" edit="0" delete="0"> <sheet> <group> <group> <field name="booking_id" readonly="1"/> <field name="table_id" options="{'no_open':1, 'no_create':1}"/> </group> <group> <field name="datetime_start"/> <field name="datetime_stop"/> <field name="duration"/> </group> </group> </sheet> </form> </field> </record>
<record id="restaurant_table_booking_tree" model="ir.ui.view"> <field name="name">Booking restaurant.table_booking tree</field> <field name="model">restaurant.table_booking</field> <field name="arch" type="xml"> <tree create="0" edit="0" delete="0"> <field name="booking_id" options="{'no_create':1}"/> <field name="table_id" options="{'no_open':1, 'no_create':1}"/> <field name="datetime_start"/> <field name="datetime_stop"/> <field name="duration"/> </tree> </field> </record>
<record id="restaurant_table_booking_gantt" model="ir.ui.view"> <field name="name">Booking restaurant.table_booking gantt</field> <field name="model">restaurant.table_booking</field> <field name="arch" type="xml"> <gantt string="Tables bookings" date_start="datetime_start" date_stop="datetime_stop" scales="day,week" default_scale="day" precision="{'day': 'hour:half', 'week': 'day:half'}" default_group_by="table_id" color="color" create="true" on_create="pos_restaurant_table_booking.create_new_booking_act_window" cell_create="true" edit="false"> <field name="name"/> <field name="booking_id"/> <field name="duration"/> <field name="count"/> <templates> <div t-name="gantt-popover" class="container-fluid"> <div class="row no-gutters"> <div class="col"> <ul class="pl-1 mb-0"> <li><strong>Start : </strong> <span t-esc="userTimezoneStartDate.format('YYYY-MM-DD hh:mm A')"/></li> <li><strong>Stop : </strong> <span t-esc="userTimezoneStopDate.format('YYYY-MM-DD hh:mm A')"/></li> <li><strong>Duration : </strong> <span t-field="record.duration" t-options="{'widget':'float_time'}"/> hours</li> <li><strong>People count : </strong> <span t-field="record.count"/> pers.</li> </ul> </div> </div> </div> </templates> </gantt> </field> </record>
<record id="restaurant_table_booking_search" model="ir.ui.view"> <field name="name">Booking restaurant.table_booking search</field> <field name="model">restaurant.table_booking</field> <field name="arch" type="xml"> <search> <field name="name"/> <field name="table_id"/> <field name="datetime_start"/> <group expand="0" string="Filters"> <filter name="this_week" string="This week" domain="[('datetime_start','>=',(context_today() + relativedelta(weekday=0)).strftime('%Y-%m-%d 00:00:00')),('date','<=',(context_today() + relativedelta(weekday=6)).strftime('%Y-%m-%d 23:59:59'))]"/> <filter name="next_week" string="Next week" domain="[('datetime_start','>=',(context_today() + relativedelta(weeks=1, weekday=0)).strftime('%Y-%m-%d 00:00:00')),('date','<=',(context_today() + relativedelta(weeks=1, weekday=6)).strftime('%Y-%m-%d 23:59:59'))]"/> <separator/> <filter name="upcoming" string="Upcoming" domain="[('datetime_start','>=',context_today().strftime('%Y-%m-%d 00:00:00'))]"/> </group> <group expand="0" string="Group By"> <filter name="by_booking" string="Booking" domain="[]" context="{'group_by': 'booking_id'}"/> <filter name="by_table" string="Table" domain="[]" context="{'group_by': 'table_id'}"/> <filter name="by_date" string="Date" domain="[]" context="{'group_by': 'datetime_start:day'}"/> </group> </search> </field> </record>
<record id="restaurant_table_booking_act_window" model="ir.actions.act_window"> <field name="name">Tables bookings</field> <field name="res_model">restaurant.table_booking</field> <field name="view_mode">gantt,form</field> <field name="context">{'search_default_upcoming':1}</field> <field name="help" type="html"> <p class="o_view_nocontent_smiling_face"> Schedule a new booking. </p><p> To book, you must provide a name, a date, start and stop hours, the people count and one or more tables. </p> </field> </record>
<menuitem id="restaurant_table_booking_menu" name="Tables bookings" parent="restaurant_booking_root_menu" action="restaurant_table_booking_act_window" sequence="20" groups="point_of_sale.group_pos_user"/>
</odoo>
|