Tower: upload laundry_management 19.0.19.0.4 (via marketplace)
This commit is contained in:
309
addons/laundry_management/views/laundry_session_views.xml
Normal file
309
addons/laundry_management/views/laundry_session_views.xml
Normal file
@@ -0,0 +1,309 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
|
||||
<!-- ═══════════════════════════════════════════════════════════════
|
||||
SESSION — Form View
|
||||
═══════════════════════════════════════════════════════════════ -->
|
||||
<record id="view_laundry_session_form" model="ir.ui.view">
|
||||
<field name="name">laundry.session.form</field>
|
||||
<field name="model">laundry.session</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Laundry Session">
|
||||
<header>
|
||||
<button name="action_open_session"
|
||||
string="Open Session"
|
||||
type="object"
|
||||
class="btn-primary"
|
||||
invisible="state != 'new'"/>
|
||||
<button name="action_close_session"
|
||||
string="Close Session"
|
||||
type="object"
|
||||
class="btn-warning"
|
||||
invisible="state != 'opened'"/>
|
||||
<button name="action_print_session_report"
|
||||
string="Print Report"
|
||||
type="object"
|
||||
icon="fa-print"
|
||||
invisible="state == 'new'"/>
|
||||
<field name="state" widget="statusbar"
|
||||
statusbar_visible="new,opened,closed"/>
|
||||
</header>
|
||||
<sheet>
|
||||
<!-- Smart buttons -->
|
||||
<div class="oe_button_box" name="button_box">
|
||||
<button name="action_view_orders"
|
||||
type="object"
|
||||
class="oe_stat_button"
|
||||
icon="fa-list-alt"
|
||||
invisible="order_count == 0">
|
||||
<field name="order_count"
|
||||
widget="statinfo"
|
||||
string="Orders"/>
|
||||
</button>
|
||||
<button class="oe_stat_button"
|
||||
type="object"
|
||||
name="action_view_orders"
|
||||
icon="fa-money">
|
||||
<field name="total_sales"
|
||||
widget="statinfo"
|
||||
string="Sales"/>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="oe_title">
|
||||
<h1><field name="name" readonly="1"/></h1>
|
||||
</div>
|
||||
|
||||
<group>
|
||||
<group string="Session Info">
|
||||
<field name="user_id"
|
||||
options="{'no_create_edit': True}"/>
|
||||
<field name="opening_datetime" readonly="1"/>
|
||||
<field name="closing_datetime" readonly="1"
|
||||
invisible="state != 'closed'"/>
|
||||
<field name="company_id"
|
||||
groups="base.group_multi_company"/>
|
||||
</group>
|
||||
<group string="Opening Cash">
|
||||
<field name="opening_cash"
|
||||
readonly="state != 'new'"/>
|
||||
<field name="difference_account_id"
|
||||
options="{'no_create': True, 'no_create_edit': True}"
|
||||
readonly="state == 'closed'"/>
|
||||
</group>
|
||||
</group>
|
||||
|
||||
<notebook>
|
||||
<!-- FINANCIAL SUMMARY TAB -->
|
||||
<page string="Summary" name="summary">
|
||||
<group>
|
||||
<group string="Sales Breakdown">
|
||||
<field name="total_sales" readonly="1"/>
|
||||
<field name="total_paid" readonly="1"/>
|
||||
<field name="outstanding_amount" readonly="1"/>
|
||||
</group>
|
||||
<group string="Payment Methods">
|
||||
<field name="total_cash" readonly="1"/>
|
||||
<field name="total_bank" readonly="1"/>
|
||||
<field name="total_credit" readonly="1"/>
|
||||
</group>
|
||||
</group>
|
||||
<group string="Cash Control"
|
||||
invisible="state == 'new'">
|
||||
<group>
|
||||
<field name="opening_cash" readonly="1"
|
||||
string="Opening Float"/>
|
||||
<field name="total_cash" readonly="1"
|
||||
string="+ Cash Received"/>
|
||||
<field name="expected_closing_cash" readonly="1"/>
|
||||
</group>
|
||||
<group invisible="state != 'closed'">
|
||||
<field name="actual_closing_cash" readonly="1"/>
|
||||
<field name="cash_difference" readonly="1"
|
||||
widget="monetary"
|
||||
decoration-danger="cash_difference < 0"
|
||||
decoration-success="cash_difference >= 0"/>
|
||||
</group>
|
||||
</group>
|
||||
<group string="Notes" invisible="not notes">
|
||||
<field name="notes" nolabel="1" readonly="1"/>
|
||||
</group>
|
||||
</page>
|
||||
|
||||
<!-- ORDERS TAB — uses sale.order fields -->
|
||||
<page string="Orders" name="orders">
|
||||
<field name="order_ids" readonly="1">
|
||||
<list>
|
||||
<field name="name" string="Order No."/>
|
||||
<field name="partner_id" string="Customer"/>
|
||||
<field name="mobile" optional="show"/>
|
||||
<field name="date_order" string="Date"/>
|
||||
<field name="amount_total" string="Total" sum="Total"/>
|
||||
<field name="amount_due" string="Balance Due" optional="show"/>
|
||||
<field name="laundry_payment_status"
|
||||
string="Payment"
|
||||
widget="badge"
|
||||
decoration-success="laundry_payment_status == 'paid'"
|
||||
decoration-warning="laundry_payment_status == 'partial'"
|
||||
decoration-danger="laundry_payment_status == 'unpaid'"/>
|
||||
<field name="laundry_state"
|
||||
string="Processing"
|
||||
widget="badge"
|
||||
decoration-success="laundry_state == 'delivered'"
|
||||
decoration-warning="laundry_state == 'processing'"
|
||||
decoration-primary="laundry_state == 'ready'"
|
||||
decoration-info="laundry_state == 'intake'"/>
|
||||
<field name="state"
|
||||
widget="badge"
|
||||
decoration-info="state == 'draft'"
|
||||
decoration-success="state == 'sale'"
|
||||
decoration-danger="state == 'cancel'"
|
||||
optional="show"/>
|
||||
</list>
|
||||
</field>
|
||||
</page>
|
||||
</notebook>
|
||||
</sheet>
|
||||
<chatter/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- ═══════════════════════════════════════════════════════════════
|
||||
SESSION — List View
|
||||
═══════════════════════════════════════════════════════════════ -->
|
||||
<record id="view_laundry_session_list" model="ir.ui.view">
|
||||
<field name="name">laundry.session.list</field>
|
||||
<field name="model">laundry.session</field>
|
||||
<field name="arch" type="xml">
|
||||
<list string="Laundry Sessions">
|
||||
<field name="name"/>
|
||||
<field name="user_id"/>
|
||||
<field name="opening_datetime"/>
|
||||
<field name="closing_datetime" optional="show"/>
|
||||
<field name="order_count"/>
|
||||
<field name="total_sales" sum="Total Sales"/>
|
||||
<field name="total_cash" sum="Cash" optional="show"/>
|
||||
<field name="total_bank" sum="Bank/Card" optional="show"/>
|
||||
<field name="total_credit" sum="Credit" optional="show"/>
|
||||
<field name="state"
|
||||
widget="badge"
|
||||
decoration-success="state == 'closed'"
|
||||
decoration-warning="state == 'opened'"
|
||||
decoration-info="state == 'new'"/>
|
||||
</list>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- ═══════════════════════════════════════════════════════════════
|
||||
SESSION — Search View
|
||||
═══════════════════════════════════════════════════════════════ -->
|
||||
<record id="view_laundry_session_search" model="ir.ui.view">
|
||||
<field name="name">laundry.session.search</field>
|
||||
<field name="model">laundry.session</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Sessions">
|
||||
<field name="name" string="Session"/>
|
||||
<field name="user_id" string="Staff"/>
|
||||
<filter string="Open" name="opened"
|
||||
domain="[('state','=','opened')]"/>
|
||||
<filter string="Closed" name="closed"
|
||||
domain="[('state','=','closed')]"/>
|
||||
<filter string="Today" name="today"
|
||||
domain="[('opening_datetime','>=',context_today().strftime('%Y-%m-%d'))]"/>
|
||||
<separator/>
|
||||
<filter string="By Staff" name="by_user"
|
||||
context="{'group_by':'user_id'}"/>
|
||||
<filter string="By Month" name="by_month"
|
||||
context="{'group_by':'opening_datetime:month'}"/>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- ═══════════════════════════════════════════════════════════════
|
||||
SESSION CLOSE WIZARD — View
|
||||
═══════════════════════════════════════════════════════════════ -->
|
||||
<record id="view_laundry_session_close_wizard_form" model="ir.ui.view">
|
||||
<field name="name">laundry.session.close.wizard.form</field>
|
||||
<field name="model">laundry.session.close.wizard</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Close Session">
|
||||
<sheet>
|
||||
<div class="alert alert-warning mb-3" role="alert">
|
||||
<strong>Closing Session: </strong>
|
||||
<field name="session_id" readonly="1" nolabel="1"/>
|
||||
<br/>
|
||||
Count the cash in the drawer and enter the total below.
|
||||
</div>
|
||||
|
||||
<group string="Session Summary">
|
||||
<group>
|
||||
<field name="order_count" string="Orders Processed" readonly="1"/>
|
||||
<field name="total_sales" readonly="1"/>
|
||||
<field name="total_paid" readonly="1"/>
|
||||
<field name="outstanding_amount" readonly="1"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="total_cash" readonly="1"/>
|
||||
<field name="total_bank" readonly="1"/>
|
||||
<field name="total_credit" readonly="1"/>
|
||||
</group>
|
||||
</group>
|
||||
|
||||
<group string="Cash Control">
|
||||
<group>
|
||||
<field name="opening_cash" readonly="1" string="Opening Float"/>
|
||||
<field name="total_cash" readonly="1" string="+ Cash Received"/>
|
||||
<field name="expected_closing_cash" readonly="1"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="actual_closing_cash"/>
|
||||
<field name="cash_difference" readonly="1"
|
||||
decoration-danger="cash_difference < 0"
|
||||
decoration-success="cash_difference >= 0"/>
|
||||
</group>
|
||||
</group>
|
||||
|
||||
<group string="Cash Difference Entry"
|
||||
invisible="cash_difference == 0">
|
||||
<group>
|
||||
<field name="post_difference_entry"/>
|
||||
</group>
|
||||
<group invisible="not post_difference_entry">
|
||||
<field name="difference_account_id"
|
||||
options="{'no_create': True}"/>
|
||||
</group>
|
||||
</group>
|
||||
|
||||
<group string="Notes">
|
||||
<field name="closing_notes" nolabel="1"
|
||||
placeholder="Any remarks about this session…"/>
|
||||
</group>
|
||||
</sheet>
|
||||
<footer>
|
||||
<button name="action_close"
|
||||
string="Close Session"
|
||||
type="object"
|
||||
class="btn-primary"/>
|
||||
<button string="Cancel"
|
||||
class="btn-secondary"
|
||||
special="cancel"/>
|
||||
</footer>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- ═══════════════════════════════════════════════════════════════
|
||||
ACTIONS
|
||||
═══════════════════════════════════════════════════════════════ -->
|
||||
<record id="action_laundry_session" model="ir.actions.act_window">
|
||||
<field name="name">Sessions</field>
|
||||
<field name="res_model">laundry.session</field>
|
||||
<field name="view_mode">list,form</field>
|
||||
<field name="search_view_id" ref="view_laundry_session_search"/>
|
||||
<field name="help" type="html">
|
||||
<p class="o_view_nocontent_smiling_face">
|
||||
No sessions yet — open your first daily session!
|
||||
</p>
|
||||
<p>
|
||||
Sessions track daily orders and cash flow,
|
||||
similar to a Point of Sale day shift.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_laundry_session_open" model="ir.actions.act_window">
|
||||
<field name="name">Current Session</field>
|
||||
<field name="res_model">laundry.session</field>
|
||||
<field name="view_mode">list,form</field>
|
||||
<field name="domain">[('state','=','opened')]</field>
|
||||
<field name="search_view_id" ref="view_laundry_session_search"/>
|
||||
<field name="help" type="html">
|
||||
<p class="o_view_nocontent_smiling_face">
|
||||
No session is currently open.
|
||||
</p>
|
||||
<p>Go to All Sessions to open a new session for today.</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user