point_of_sale_dashboard.xml 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <odoo>
  3. <record id="action_pos_session_filtered" model="ir.actions.act_window">
  4. <field name="name">Sessions</field>
  5. <field name="type">ir.actions.act_window</field>
  6. <field name="res_model">pos.session</field>
  7. <field name="view_mode">tree,form</field>
  8. <field name="search_view_id" ref="view_pos_session_search" />
  9. <field name="context">{
  10. 'search_default_config_id': [active_id],
  11. 'default_config_id': active_id}
  12. </field>
  13. </record>
  14. <record id="action_pos_order_filtered" model="ir.actions.act_window">
  15. <field name="name">Orders</field>
  16. <field name="type">ir.actions.act_window</field>
  17. <field name="res_model">pos.order</field>
  18. <field name="view_mode">tree,form</field>
  19. <field name="search_view_id" ref="view_pos_order_search"/>
  20. <field name="context">{
  21. 'search_default_config_id': [active_id],
  22. 'default_config_id': active_id}
  23. </field>
  24. </record>
  25. <record id="action_report_pos_order_all_filtered" model="ir.actions.act_window">
  26. <field name="name">Orders Analysis</field>
  27. <field name="res_model">report.pos.order</field>
  28. <field name="view_mode">graph,pivot</field>
  29. <field name="search_view_id" ref="view_report_pos_order_search"/>
  30. <field name="context">{
  31. 'search_default_config_id': [active_id],
  32. 'default_config_id': active_id}
  33. </field>
  34. <field name="help" type="html">
  35. <p class="o_view_nocontent_smiling_face">
  36. No data yet!
  37. </p><p>
  38. Create a new POS order
  39. </p>
  40. </field>
  41. </record>
  42. <!-- Dashboard -->
  43. <record id="view_pos_config_kanban" model="ir.ui.view">
  44. <field name="name">pos.config.kanban.view</field>
  45. <field name="model">pos.config</field>
  46. <field name="arch" type="xml">
  47. <kanban create="false" class="o_kanban_dashboard o_pos_kanban">
  48. <field name="current_user_id" invisible="1" />
  49. <field name="cash_control" invisible="1"/>
  50. <field name="name"/>
  51. <field name="current_session_id"/>
  52. <field name="current_session_state"/>
  53. <field name="last_session_closing_date"/>
  54. <field name="pos_session_username"/>
  55. <field name="pos_session_state"/>
  56. <field name="pos_session_duration"/>
  57. <field name="currency_id"/>
  58. <field name="number_of_opened_session"/>
  59. <templates>
  60. <t t-name="kanban-box">
  61. <div>
  62. <div class="o_kanban_card_header">
  63. <div class="o_kanban_card_header_title mb16">
  64. <div class="o_primary">
  65. <t t-esc="record.name.value"/>
  66. </div>
  67. <t t-if="!record.current_session_id.raw_value &amp;&amp; record.pos_session_username.value">
  68. <div class="badge text-bg-info o_kanban_inline_block">Opened by <t t-esc="record.pos_session_username.value"/></div>
  69. </t>
  70. <t t-if="record.pos_session_state.raw_value == 'opening_control'">
  71. <div class="badge text-bg-info o_kanban_inline_block">Opening Control</div>
  72. </t>
  73. <t t-if="record.pos_session_state.raw_value == 'closing_control'">
  74. <div class="badge text-bg-info o_kanban_inline_block">Closing Control</div>
  75. </t>
  76. <t t-if="record.pos_session_state.raw_value == 'opened' and record.pos_session_duration.raw_value > 1">
  77. <div t-attf-class="badge bg-#{record.pos_session_duration.raw_value > 3 and 'danger' or 'warning'} o_kanban_inline_block"
  78. title="The session has been opened for an unusually long period. Please consider closing.">
  79. To Close
  80. </div>
  81. </t>
  82. </div>
  83. <div class="o_kanban_manage_button_section">
  84. <a class="o_kanban_manage_toggle_button" href="#"><i class="fa fa-ellipsis-v" role="img" aria-label="Manage" title="Manage"/></a>
  85. </div>
  86. </div>
  87. <div class="container o_kanban_card_content">
  88. <div class="row">
  89. <div class="col-6 o_kanban_primary_left">
  90. <button t-if="record.current_session_state.raw_value != 'closing_control'" class="btn btn-primary" name="open_ui" type="object">
  91. <t t-if="record.current_session_state.raw_value === 'opened'">Continue selling</t>
  92. <t t-elif="!record.current_session_id.raw_value &amp;&amp; !record.pos_session_username.value">New Session</t>
  93. <t t-elif="record.current_session_state.raw_value === 'opening_control'">Open Session</t>
  94. </button>
  95. <button t-else="" class="btn btn-secondary" name="open_existing_session_cb" type="object">Close</button>
  96. </div>
  97. <div class="col-6 o_kanban_primary_right">
  98. <div t-if="record.last_session_closing_date.value" class="row">
  99. <div class="col-6">
  100. <span>Last Closing Date</span>
  101. </div>
  102. <div class="col-6">
  103. <span><t t-esc="record.last_session_closing_date.value"/></span>
  104. </div>
  105. </div>
  106. <div t-if="record.last_session_closing_date.value" attrs='{"invisible": [("cash_control","=",False)]}' class="row">
  107. <div class="col-6">
  108. <span>Last Closing Cash Balance</span>
  109. </div>
  110. <div class="col-6">
  111. <span><field name="last_session_closing_cash" widget="monetary"/></span>
  112. </div>
  113. </div>
  114. <button t-if="record.number_of_opened_session.value &gt; 1" class="btn btn-link" style="padding-left:0; text-decoration: underline" name="open_opened_session_list" type="object">
  115. There are <t t-esc="record.number_of_opened_session.value"/> open sessions
  116. </button>
  117. </div>
  118. </div>
  119. <div style="text-align:right;">
  120. <field name="current_user_id" widget="many2one_avatar_user"/>
  121. </div>
  122. </div><div class="container o_kanban_card_manage_pane dropdown-menu" role="menu">
  123. <div class="row">
  124. <div class="col-6 o_kanban_card_manage_section o_kanban_manage_view">
  125. <div role="menuitem" class="o_kanban_card_manage_title">
  126. <span>View</span>
  127. </div>
  128. <div role="menuitem">
  129. <a name="%(action_pos_order_filtered)d" type="action">Orders</a>
  130. </div>
  131. <div role="menuitem">
  132. <a name="%(action_pos_session_filtered)d" type="action">Sessions</a>
  133. </div>
  134. </div>
  135. <div class="col-6 o_kanban_card_manage_section o_kanban_manage_new">
  136. <div role="menuitem" class="o_kanban_card_manage_title">
  137. <span>Reporting</span>
  138. </div>
  139. <div role="menuitem">
  140. <a name="%(action_report_pos_order_all_filtered)d" type="action">Orders</a>
  141. </div>
  142. </div>
  143. </div>
  144. <div t-if="widget.editable" class="o_kanban_card_manage_settings row" groups="point_of_sale.group_pos_manager">
  145. <div role="menuitem" class="col-12">
  146. <a name="action_pos_config_modal_edit" type="object">Edit</a>
  147. </div>
  148. </div>
  149. </div>
  150. </div>
  151. </t>
  152. </templates>
  153. </kanban>
  154. </field>
  155. </record>
  156. </odoo>