182 lines
10 KiB
XML
182 lines
10 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<odoo>
|
|
<!-- Table Kanban View (Custom Dine360 UI) -->
|
|
<record id="view_restaurant_table_kanban" model="ir.ui.view">
|
|
<field name="name">restaurant.table.kanban.dine360</field>
|
|
<field name="model">restaurant.table</field>
|
|
<field name="arch" type="xml">
|
|
<kanban class="o_kanban_mobile" default_group_by="floor_id" sample="1">
|
|
<field name="id"/>
|
|
<field name="name"/>
|
|
<field name="seats"/>
|
|
<field name="shape"/>
|
|
<field name="floor_id"/>
|
|
<field name="color"/>
|
|
<templates>
|
|
<t t-name="kanban-box">
|
|
<div t-attf-class="oe_kanban_global_click o_dine360_table_card p-3 mb-2"
|
|
style="border-radius: 16px; border: 1px solid #e2e8f0; background: #ffffff; box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05); min-height: 155px; transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1); display: flex; flex-direction: column; justify-content: space-between;">
|
|
|
|
<!-- Header: Floor Badge & Shape Badge -->
|
|
<div class="d-flex align-items-center justify-content-between mb-2">
|
|
<span class="badge rounded-pill px-2.5 py-1" style="background: #f1f5f9; color: #475569; font-size: 11.5px; font-weight: 600; border: 1px solid #e2e8f0;">
|
|
<i class="fa fa-map-marker text-danger me-1"/>
|
|
<t t-esc="record.floor_id.value or 'Main Hall'"/>
|
|
</span>
|
|
<t t-if="record.shape.raw_value == 'round'">
|
|
<span class="badge rounded-pill px-2.5 py-1" style="background: #eff6ff; color: #2563eb; font-size: 11px; font-weight: 600; border: 1px solid #bfdbfe;">
|
|
<i class="fa fa-circle-o me-1"/> Round Table
|
|
</span>
|
|
</t>
|
|
<t t-else="">
|
|
<span class="badge rounded-pill px-2.5 py-1" style="background: #f8fafc; color: #64748b; font-size: 11px; font-weight: 600; border: 1px solid #e2e8f0;">
|
|
<i class="fa fa-square-o me-1"/> Square Table
|
|
</span>
|
|
</t>
|
|
</div>
|
|
|
|
<!-- Middle: Icon and Big Table Label -->
|
|
<div class="d-flex align-items-center gap-3 my-2">
|
|
<div class="d-flex align-items-center justify-content-center"
|
|
style="width: 48px; height: 48px; border-radius: 12px; background: #fee2e2; color: #e50000; font-size: 20px; flex-shrink: 0; box-shadow: 0 2px 8px rgba(229, 0, 0, 0.15);">
|
|
<i class="fa fa-cutlery"/>
|
|
</div>
|
|
<div class="overflow-hidden">
|
|
<div class="fw-bold text-dark text-truncate" style="font-size: 18px; letter-spacing: -0.3px;">
|
|
<t t-esc="record.name.value"/>
|
|
</div>
|
|
<div class="text-muted small">
|
|
Dining Zone
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Footer: Capacity & Indicator -->
|
|
<div class="d-flex align-items-center justify-content-between pt-2.5 border-top mt-2">
|
|
<span class="badge rounded-pill px-2.5 py-1"
|
|
style="background: #ecfdf5; color: #059669; font-size: 12px; font-weight: 600; border: 1px solid #a7f3d0;">
|
|
<i class="fa fa-users me-1 text-success"/>
|
|
<t t-esc="record.seats.value"/> Seats
|
|
</span>
|
|
<span class="text-muted small font-monospace">
|
|
ID #<t t-esc="record.id.raw_value"/>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
</t>
|
|
</templates>
|
|
</kanban>
|
|
</field>
|
|
</record>
|
|
|
|
<!-- Tree View (Custom Dine360 Modern Tree) -->
|
|
<record id="view_restaurant_table_tree" model="ir.ui.view">
|
|
<field name="name">restaurant.table.tree.dine360</field>
|
|
<field name="model">restaurant.table</field>
|
|
<field name="arch" type="xml">
|
|
<tree string="Restaurant Tables" sample="1">
|
|
<field name="name" string="Table Label / Number" class="fw-bold text-dark"/>
|
|
<field name="floor_id" string="Dining Floor" widget="badge" decoration-info="floor_id"/>
|
|
<field name="seats" string="Seating Capacity" widget="badge" decoration-danger="seats >= 6" decoration-success="seats < 6 and seats >= 4" decoration-info="seats < 4"/>
|
|
<field name="shape" string="Table Shape" widget="badge" decoration-warning="shape == 'round'" decoration-muted="shape == 'square'"/>
|
|
<field name="position_h" optional="hide"/>
|
|
<field name="position_v" optional="hide"/>
|
|
<field name="width" optional="hide"/>
|
|
<field name="height" optional="hide"/>
|
|
</tree>
|
|
</field>
|
|
</record>
|
|
|
|
<!-- Search View with Floor Search Panel -->
|
|
<record id="view_restaurant_table_search" model="ir.ui.view">
|
|
<field name="name">restaurant.table.search.dine360</field>
|
|
<field name="model">restaurant.table</field>
|
|
<field name="arch" type="xml">
|
|
<search string="Search Tables">
|
|
<field name="name" string="Table Name"/>
|
|
<field name="floor_id" string="Dining Floor"/>
|
|
<separator/>
|
|
<filter string="Square Tables" name="filter_square" domain="[('shape', '=', 'square')]"/>
|
|
<filter string="Round Tables" name="filter_round" domain="[('shape', '=', 'round')]"/>
|
|
<separator/>
|
|
<filter string="Family / Large (4+ Seats)" name="filter_large" domain="[('seats', '>=', 4)]"/>
|
|
<filter string="Couples / Small (1-2 Seats)" name="filter_small" domain="[('seats', '<=', 2)]"/>
|
|
<group expand="1" string="Group By">
|
|
<filter string="Dining Floor" name="group_floor" context="{'group_by': 'floor_id'}"/>
|
|
<filter string="Table Shape" name="group_shape" context="{'group_by': 'shape'}"/>
|
|
<filter string="Seat Capacity" name="group_seats" context="{'group_by': 'seats'}"/>
|
|
</group>
|
|
<searchpanel>
|
|
<field name="floor_id" icon="fa-th-large" color="#e50000" enable_counters="1"/>
|
|
<field name="shape" icon="fa-square-o" enable_counters="1"/>
|
|
</searchpanel>
|
|
</search>
|
|
</field>
|
|
</record>
|
|
|
|
<!-- Form View -->
|
|
<record id="view_restaurant_table_form" model="ir.ui.view">
|
|
<field name="name">restaurant.table.form.dine360</field>
|
|
<field name="model">restaurant.table</field>
|
|
<field name="arch" type="xml">
|
|
<form string="Restaurant Table">
|
|
<sheet>
|
|
<div class="oe_title">
|
|
<label for="name" string="Table Name / Number" class="oe_edit_only text-muted small fw-bold"/>
|
|
<h1 class="text-danger fw-bold">
|
|
<field name="name" placeholder="e.g. Table 1, VIP-1..."/>
|
|
</h1>
|
|
</div>
|
|
<group>
|
|
<group string="Dining Setup" name="basic_config">
|
|
<field name="floor_id" options="{'no_create': True}" required="1"/>
|
|
<field name="seats" string="Seating Capacity (Seats)"/>
|
|
<field name="shape"/>
|
|
</group>
|
|
<group string="Point of Sale Visual Coordinates" name="pos_layout">
|
|
<field name="position_h"/>
|
|
<field name="position_v"/>
|
|
<field name="width"/>
|
|
<field name="height"/>
|
|
</group>
|
|
</group>
|
|
</sheet>
|
|
</form>
|
|
</field>
|
|
</record>
|
|
|
|
<!-- Table Window Action -->
|
|
<record id="action_restaurant_table_form" model="ir.actions.act_window">
|
|
<field name="name">Tables</field>
|
|
<field name="res_model">restaurant.table</field>
|
|
<field name="view_mode">kanban,tree,form</field>
|
|
<field name="search_view_id" ref="view_restaurant_table_search"/>
|
|
<field name="view_id" ref="view_restaurant_table_kanban"/>
|
|
<field name="help" type="html">
|
|
<p class="o_view_nocontent_smiling_face">
|
|
Create your first dining table!
|
|
</p>
|
|
<p>
|
|
Configure tables on your restaurant floors with shape and guest seating capacity.
|
|
</p>
|
|
</field>
|
|
</record>
|
|
|
|
<!-- Table Window Action Alias -->
|
|
<record id="action_restaurant_table" model="ir.actions.act_window">
|
|
<field name="name">Tables</field>
|
|
<field name="res_model">restaurant.table</field>
|
|
<field name="view_mode">kanban,tree,form</field>
|
|
<field name="search_view_id" ref="view_restaurant_table_search"/>
|
|
<field name="view_id" ref="view_restaurant_table_kanban"/>
|
|
<field name="help" type="html">
|
|
<p class="o_view_nocontent_smiling_face">
|
|
Create your first dining table!
|
|
</p>
|
|
<p>
|
|
Configure tables on your restaurant floors with shape and guest seating capacity.
|
|
</p>
|
|
</field>
|
|
</record>
|
|
</odoo>
|