| 1 |
<?xml version="1.0" encoding="utf-8"?> |
| 2 |
<odoo> |
| 3 |
<record id="view_pos_session_form" model="ir.ui.view"> |
| 4 |
<field name="name">pos.session.form.view</field> |
| 5 |
<field name="model">pos.session</field> |
| 6 |
<field name="arch" type="xml"> |
| 7 |
<form string="Point of Sale Session" create="0" edit="0"> |
| 8 |
<header> |
| 9 |
<button name="open_frontend_cb" type="object" string="Continue Selling" |
| 10 |
invisible="rescue or state not in ['opening_control', 'opened']"/> |
| 11 |
<button id="validate_closing_control" name="action_pos_session_closing_control" type="object" string="Close Session & Post Entries" |
| 12 |
invisible="(state != 'closing_control' and not rescue or state == 'closed' and rescue) and state != 'closing_control'" |
| 13 |
class="oe_highlight"/> |
| 14 |
<field name="state" widget="statusbar" statusbar_visible="opened,closing_control,closed" nolabel="1" /> |
| 15 |
</header> |
| 16 |
<sheet> |
| 17 |
<field name="failed_pickings" invisible="1"/> |
| 18 |
<field name="rescue" invisible="1"/> |
| 19 |
<div class="oe_button_box" name="button_box"> |
| 20 |
<button name="action_view_order" |
| 21 |
class="oe_stat_button" |
| 22 |
icon="fa-shopping-basket" |
| 23 |
type="object"> |
| 24 |
<field name="order_count" widget="statinfo" string="Orders"/> |
| 25 |
</button> |
| 26 |
<button class="oe_stat_button" name="action_stock_picking" type="object" icon="fa-truck" invisible="picking_count == 0"> |
| 27 |
<field name="picking_count" widget="statinfo" string="Pickings" invisible="failed_pickings"/> |
| 28 |
<field name="picking_count" widget="statinfo" string="Pickings" class="text-danger" invisible="not failed_pickings"/> |
| 29 |
</button> |
| 30 |
<button |
| 31 |
name="action_show_payments_list" |
| 32 |
type="object" |
| 33 |
class="oe_stat_button" |
| 34 |
icon="fa-dollar" |
| 35 |
> |
| 36 |
<field name="total_payments_amount" widget="statinfo" string="Payments"/> |
| 37 |
</button> |
| 38 |
<button |
| 39 |
name="show_journal_items" |
| 40 |
type="object" |
| 41 |
class="oe_stat_button" |
| 42 |
icon="fa-bars" |
| 43 |
groups="account.group_account_readonly" |
| 44 |
> |
| 45 |
<div class="o_stat_info"> |
| 46 |
<span class="o_stat_text">Journal Items</span> |
| 47 |
</div> |
| 48 |
</button> |
| 49 |
<button |
| 50 |
name="show_cash_register" |
| 51 |
type="object" |
| 52 |
class="oe_stat_button" |
| 53 |
icon="fa-bars" |
| 54 |
invisible="not cash_control" |
| 55 |
groups="account.group_account_readonly"> |
| 56 |
<div class="o_stat_info"> |
| 57 |
<span class="o_stat_text">Cash Register</span> |
| 58 |
</div> |
| 59 |
</button> |
| 60 |
</div> |
| 61 |
<h1 class="oe_title"> |
| 62 |
<field name="name" invisible="name == '/'" class="oe_inline"/> |
| 63 |
</h1> |
| 64 |
<group> |
| 65 |
<field name="cash_control" invisible="1" /> |
| 66 |
<field name="user_id" readonly="state != 'opening_control'"/> |
| 67 |
<field name="currency_id" invisible="1"/> |
| 68 |
<field name="config_id" readonly="1"/> |
| 69 |
<field name="move_id" readonly="1" groups="account.group_account_readonly" /> |
| 70 |
<field name="start_at" invisible="state == 'opening_control'"/> |
| 71 |
<field name="stop_at" invisible="state != 'closed'"/> |
| 72 |
<field name="cash_register_balance_start"/> |
| 73 |
<field name="cash_register_balance_end_real" invisible="state != 'closed'"/> |
| 74 |
</group> |
| 75 |
</sheet> |
| 76 |
<chatter/> |
| 77 |
</form> |
| 78 |
</field> |
| 79 |
</record> |
| 80 |
|
| 81 |
<record id="view_pos_session_tree" model="ir.ui.view"> |
| 82 |
<field name="name">pos.session.list.view</field> |
| 83 |
<field name="model">pos.session</field> |
| 84 |
<field name="arch" type="xml"> |
| 85 |
<list string="Point of Sale Session" create="0" sample="1"> |
| 86 |
<field name="name" decoration-bf="1"/> |
| 87 |
<field name="config_id" /> |
| 88 |
<field name="user_id" widget="many2one_avatar_user" readonly="state != 'opening_control'"/> |
| 89 |
<field name="start_at" /> |
| 90 |
<field name="stop_at" /> |
| 91 |
<field name="cash_register_balance_start"/> |
| 92 |
<field name="cash_register_balance_end_real"/> |
| 93 |
<field name="cash_register_balance_end"/> |
| 94 |
<field name="state" widget="badge" decoration-info="state in ('opening_control')" decoration-success="state in ('opened', 'closed')" decoration-warning="state == 'closing_control'" /> |
| 95 |
</list> |
| 96 |
</field> |
| 97 |
</record> |
| 98 |
|
| 99 |
<record model="ir.ui.view" id="view_pos_session_kanban"> |
| 100 |
<field name="name">pos.session.kanban</field> |
| 101 |
<field name="model">pos.session</field> |
| 102 |
<field name="arch" type="xml"> |
| 103 |
<kanban class="o_kanban_mobile" create="0" sample="1"> |
| 104 |
<templates> |
| 105 |
<t t-name="card"> |
| 106 |
<div class="d-flex"> |
| 107 |
<field name="config_id" class="fw-bolder mb-1"/> |
| 108 |
<field name="state" widget="label_selection" options="{'classes': {'opening_control': 'default', |
| 109 |
'opened': 'success', 'closing_control': 'warning', 'closed': 'warning'}}" class="ms-auto"/> |
| 110 |
</div> |
| 111 |
<field name="name" /> |
| 112 |
<footer class="pt-1"> |
| 113 |
<field name="start_at" /> |
| 114 |
<field name="user_id" widget="many2one_avatar_user" readonly="state != 'opening_control'" class="ms-auto"/> |
| 115 |
</footer> |
| 116 |
</t> |
| 117 |
</templates> |
| 118 |
</kanban> |
| 119 |
</field> |
| 120 |
</record> |
| 121 |
|
| 122 |
<record id="view_pos_session_search" model="ir.ui.view"> |
| 123 |
<field name="name">pos.session.search.view</field> |
| 124 |
<field name="model">pos.session</field> |
| 125 |
<field name="arch" type="xml"> |
| 126 |
<search string="Point of Sale Session"> |
| 127 |
<field name="name"/> |
| 128 |
<field name="config_id" /> |
| 129 |
<field name="user_id" /> |
| 130 |
<filter name="my_sessions" string="My Sessions" domain="[('user_id', '=', uid)]"/> |
| 131 |
<separator/> |
| 132 |
<filter name="open_sessions" string="In Progress" domain="[('state', '=', 'opened')]"/> |
| 133 |
<separator/> |
| 134 |
<filter string="Opening Date" name="start_date" date="start_at" /> |
| 135 |
<group> |
| 136 |
<filter string="Opened By" name="user" domain="[]" context="{'group_by' : 'user_id'}"/> |
| 137 |
<filter string="Point of Sale" name="point_of_sale" domain="[]" context="{'group_by': 'config_id'}"/> |
| 138 |
<filter string="Status" name="status" domain="[]" context="{'group_by': 'state'}"/> |
| 139 |
<filter string="Opening Date" name="opening_date" domain="[]" context="{'group_by': 'start_at'}"/> |
| 140 |
<filter string="Closing Date" name="closing_date" domain="[]" context="{'group_by': 'stop_at'}"/> |
| 141 |
</group> |
| 142 |
</search> |
| 143 |
</field> |
| 144 |
</record> |
| 145 |
|
| 146 |
<record id="action_pos_session" model="ir.actions.act_window"> |
| 147 |
<field name="name">Sessions</field> |
| 148 |
<field name="res_model">pos.session</field> |
| 149 |
<field name="path">pos-sessions</field> |
| 150 |
<field name="view_mode">list,kanban,form</field> |
| 151 |
<field name="search_view_id" ref="view_pos_session_search" /> |
| 152 |
<field name="help" type="html"> |
| 153 |
<p class="o_view_nocontent_empty_folder"> |
| 154 |
No sessions found |
| 155 |
</p><p> |
| 156 |
A session is a period of time, usually one day, during which you sell through the Point of Sale. |
| 157 |
</p> |
| 158 |
</field> |
| 159 |
</record> |
| 160 |
|
| 161 |
<record id="mail_activity_old_session" model="mail.activity.type"> |
| 162 |
<field name="name">Session open over 7 days</field> |
| 163 |
<field name="summary">note</field> |
| 164 |
<field name="category">default</field> |
| 165 |
<field name="res_model">pos.session</field> |
| 166 |
<field name="icon">fa-tasks</field> |
| 167 |
<field name="delay_count">0</field> |
| 168 |
</record> |
| 169 |
|
| 170 |
<menuitem |
| 171 |
id="menu_pos_session_all" |
| 172 |
parent="menu_point_of_sale" |
| 173 |
action="action_pos_session" |
| 174 |
sequence="2" |
| 175 |
groups="group_pos_manager"/> |
| 176 |
</odoo> |