Tower: upload laundry_management 19.0.19.0.4 (via marketplace)
This commit is contained in:
252
addons/laundry_management/views/laundry_commission_views.xml
Normal file
252
addons/laundry_management/views/laundry_commission_views.xml
Normal file
@@ -0,0 +1,252 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
|
||||
<!-- ═══════════════════════════════════════════════════════════════
|
||||
COMMISSION — Form View (PART 3: 3-state workflow)
|
||||
═══════════════════════════════════════════════════════════════ -->
|
||||
<record id="view_laundry_commission_form" model="ir.ui.view">
|
||||
<field name="name">laundry.commission.form</field>
|
||||
<field name="model">laundry.commission</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Commission">
|
||||
<header>
|
||||
<button name="action_confirm"
|
||||
string="✓ Confirm Commission"
|
||||
type="object"
|
||||
class="btn-primary"
|
||||
invisible="state != 'pending'"
|
||||
groups="laundry_management.group_laundry_manager"/>
|
||||
<button name="action_mark_paid"
|
||||
string="✓ Mark as Paid"
|
||||
type="object"
|
||||
class="btn-success"
|
||||
invisible="state == 'paid'"/>
|
||||
<button name="action_reset_pending"
|
||||
string="↩ Reset to Pending"
|
||||
type="object"
|
||||
invisible="state == 'paid' or state == 'pending'"
|
||||
groups="laundry_management.group_laundry_manager"/>
|
||||
<field name="state"
|
||||
widget="statusbar"
|
||||
statusbar_visible="pending,confirmed,paid"/>
|
||||
</header>
|
||||
<sheet>
|
||||
<div class="oe_title">
|
||||
<h1><field name="name" readonly="1"/></h1>
|
||||
</div>
|
||||
<group>
|
||||
<group string="Staff & Role / الموظف والدور">
|
||||
<field name="order_id"
|
||||
options="{'no_create_edit': True}"/>
|
||||
<field name="employee_id"
|
||||
options="{'no_create_edit': True}"/>
|
||||
<field name="role"
|
||||
widget="badge"
|
||||
decoration-info="role == 'reception'"
|
||||
decoration-warning="role == 'processing'"
|
||||
decoration-success="role == 'delivery'"/>
|
||||
<field name="date"/>
|
||||
</group>
|
||||
<group string="Commission Calculation / حساب العمولة">
|
||||
<field name="commission_type"/>
|
||||
<field name="rate" string="Rate / Amount"/>
|
||||
<field name="base_amount" readonly="1"/>
|
||||
<field name="commission_amount"
|
||||
readonly="1"
|
||||
class="fw-bold fs-5"/>
|
||||
</group>
|
||||
</group>
|
||||
<group>
|
||||
<field name="notes" placeholder="Optional notes…"/>
|
||||
</group>
|
||||
</sheet>
|
||||
<chatter/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- ═══════════════════════════════════════════════════════════════
|
||||
COMMISSION — List View
|
||||
═══════════════════════════════════════════════════════════════ -->
|
||||
<record id="view_laundry_commission_list" model="ir.ui.view">
|
||||
<field name="name">laundry.commission.list</field>
|
||||
<field name="model">laundry.commission</field>
|
||||
<field name="arch" type="xml">
|
||||
<list string="Commissions"
|
||||
decoration-muted="state == 'paid'"
|
||||
decoration-info="state == 'confirmed'"
|
||||
decoration-warning="state == 'pending'">
|
||||
<field name="name"/>
|
||||
<field name="order_id"/>
|
||||
<field name="employee_id"/>
|
||||
<field name="role"
|
||||
widget="badge"
|
||||
decoration-info="role == 'reception'"
|
||||
decoration-warning="role == 'processing'"
|
||||
decoration-success="role == 'delivery'"/>
|
||||
<field name="date"/>
|
||||
<field name="commission_type" optional="show"/>
|
||||
<field name="rate" optional="show"/>
|
||||
<field name="base_amount" optional="show"/>
|
||||
<field name="commission_amount" sum="Total Commission"/>
|
||||
<field name="state"
|
||||
widget="badge"
|
||||
decoration-warning="state == 'pending'"
|
||||
decoration-info="state == 'confirmed'"
|
||||
decoration-success="state == 'paid'"/>
|
||||
<!-- Quick actions -->
|
||||
<button name="action_confirm"
|
||||
string="Confirm"
|
||||
type="object"
|
||||
icon="fa-check"
|
||||
invisible="state != 'pending'"
|
||||
title="Confirm commission"
|
||||
groups="laundry_management.group_laundry_manager"/>
|
||||
<button name="action_mark_paid"
|
||||
string="Pay"
|
||||
type="object"
|
||||
icon="fa-check-circle"
|
||||
invisible="state == 'paid'"
|
||||
title="Mark as paid"/>
|
||||
</list>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- ═══════════════════════════════════════════════════════════════
|
||||
COMMISSION — Graph View (PART 7)
|
||||
═══════════════════════════════════════════════════════════════ -->
|
||||
<record id="view_laundry_commission_graph" model="ir.ui.view">
|
||||
<field name="name">laundry.commission.graph</field>
|
||||
<field name="model">laundry.commission</field>
|
||||
<field name="arch" type="xml">
|
||||
<graph string="Commission Analysis" type="bar">
|
||||
<field name="employee_id" type="row"/>
|
||||
<field name="commission_amount" type="measure"/>
|
||||
</graph>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- ═══════════════════════════════════════════════════════════════
|
||||
COMMISSION — Pivot View (PART 7)
|
||||
═══════════════════════════════════════════════════════════════ -->
|
||||
<record id="view_laundry_commission_pivot" model="ir.ui.view">
|
||||
<field name="name">laundry.commission.pivot</field>
|
||||
<field name="model">laundry.commission</field>
|
||||
<field name="arch" type="xml">
|
||||
<pivot string="Commission Analysis">
|
||||
<field name="employee_id" type="row"/>
|
||||
<field name="role" type="col"/>
|
||||
<field name="commission_amount" type="measure"/>
|
||||
<field name="base_amount" type="measure"/>
|
||||
</pivot>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- ═══════════════════════════════════════════════════════════════
|
||||
COMMISSION — Search View
|
||||
═══════════════════════════════════════════════════════════════ -->
|
||||
<record id="view_laundry_commission_search" model="ir.ui.view">
|
||||
<field name="name">laundry.commission.search</field>
|
||||
<field name="model">laundry.commission</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Commissions">
|
||||
<field name="name" string="Reference"/>
|
||||
<field name="order_id" string="Order"/>
|
||||
<field name="employee_id" string="Staff Member"/>
|
||||
<!-- State filters -->
|
||||
<filter string="Pending"
|
||||
name="pending"
|
||||
domain="[('state','=','pending')]"/>
|
||||
<filter string="Confirmed"
|
||||
name="confirmed"
|
||||
domain="[('state','=','confirmed')]"/>
|
||||
<filter string="Paid"
|
||||
name="paid"
|
||||
domain="[('state','=','paid')]"/>
|
||||
<!-- Unpaid (pending + confirmed) -->
|
||||
<filter string="Unpaid / Unsettled"
|
||||
name="unpaid"
|
||||
domain="[('state','!=','paid')]"/>
|
||||
<separator/>
|
||||
<!-- Date filters -->
|
||||
<filter string="This Month"
|
||||
name="this_month"
|
||||
domain="[('date','>=',context_today().strftime('%Y-%m-01'))]"/>
|
||||
<filter string="Today"
|
||||
name="today"
|
||||
domain="[('date','=',context_today().strftime('%Y-%m-%d'))]"/>
|
||||
<separator/>
|
||||
<!-- Role filters -->
|
||||
<filter string="Reception"
|
||||
name="reception"
|
||||
domain="[('role','=','reception')]"/>
|
||||
<filter string="Processing"
|
||||
name="processing"
|
||||
domain="[('role','=','processing')]"/>
|
||||
<filter string="Delivery"
|
||||
name="delivery"
|
||||
domain="[('role','=','delivery')]"/>
|
||||
<!-- Group-by -->
|
||||
<separator/>
|
||||
<filter string="By Staff"
|
||||
name="by_employee"
|
||||
context="{'group_by':'employee_id'}"/>
|
||||
<filter string="By Role"
|
||||
name="by_role"
|
||||
context="{'group_by':'role'}"/>
|
||||
<filter string="By Status"
|
||||
name="by_state"
|
||||
context="{'group_by':'state'}"/>
|
||||
<filter string="By Order"
|
||||
name="by_order"
|
||||
context="{'group_by':'order_id'}"/>
|
||||
<filter string="By Month"
|
||||
name="by_month"
|
||||
context="{'group_by':'date:month'}"/>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- ═══════════════════════════════════════════════════════════════
|
||||
ACTIONS
|
||||
═══════════════════════════════════════════════════════════════ -->
|
||||
<record id="action_laundry_commission" model="ir.actions.act_window">
|
||||
<field name="name">Staff Commissions / العمولات</field>
|
||||
<field name="res_model">laundry.commission</field>
|
||||
<field name="view_mode">list,graph,pivot,form</field>
|
||||
<field name="search_view_id" ref="view_laundry_commission_search"/>
|
||||
<field name="context">{'search_default_unpaid': 1}</field>
|
||||
<field name="view_ids" eval="[
|
||||
(5, 0, 0),
|
||||
(0, 0, {'view_mode': 'list', 'view_id': ref('view_laundry_commission_list')}),
|
||||
(0, 0, {'view_mode': 'graph', 'view_id': ref('view_laundry_commission_graph')}),
|
||||
(0, 0, {'view_mode': 'pivot', 'view_id': ref('view_laundry_commission_pivot')}),
|
||||
(0, 0, {'view_mode': 'form', 'view_id': ref('view_laundry_commission_form')}),
|
||||
]"/>
|
||||
<field name="help" type="html">
|
||||
<p class="o_view_nocontent_smiling_face">
|
||||
No commissions yet.
|
||||
</p>
|
||||
<p>
|
||||
Enable commission tracking in
|
||||
<strong>Laundry → Configuration → Settings</strong>
|
||||
and set commission rates for each stage.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_laundry_commission_all" model="ir.actions.act_window">
|
||||
<field name="name">All Commissions</field>
|
||||
<field name="res_model">laundry.commission</field>
|
||||
<field name="view_mode">list,graph,pivot,form</field>
|
||||
<field name="search_view_id" ref="view_laundry_commission_search"/>
|
||||
<field name="view_ids" eval="[
|
||||
(5, 0, 0),
|
||||
(0, 0, {'view_mode': 'list', 'view_id': ref('view_laundry_commission_list')}),
|
||||
(0, 0, {'view_mode': 'graph', 'view_id': ref('view_laundry_commission_graph')}),
|
||||
(0, 0, {'view_mode': 'pivot', 'view_id': ref('view_laundry_commission_pivot')}),
|
||||
(0, 0, {'view_mode': 'form', 'view_id': ref('view_laundry_commission_form')}),
|
||||
]"/>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user