pos_session_view.xml 9.9 KB

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