You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

135 lines
7.5 KiB

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Copyright (C) 2017 - Today: GRAP (http://www.grap.coop)
  4. @author Sylvain LE GAL (https://twitter.com/legalsylvain)
  5. @author Quentin DUPONT (https://twitter.com/pondupont)
  6. License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
  7. -->
  8. <odoo>
  9. <record id="view_pos_session_form" model="ir.ui.view">
  10. <field name="model">pos.session</field>
  11. <field name="inherit_id" ref="point_of_sale.view_pos_session_form"/>
  12. <field name="arch" type="xml">
  13. <!-- Improve views -->
  14. <field name="config_id" position="attributes">
  15. <attribute name="readonly">1</attribute>
  16. </field>
  17. <!-- Hide obsolete Buttons -->
  18. <!-- Same name button for opening and closing.. -->
  19. <xpath expr="//button[@name='open_cashbox']" position="replace">
  20. <button name="open_cashbox_opening"
  21. class="oe_stat_button"
  22. attrs="{'invisible':['|', ('cash_control', '=', False), ('state', '!=', 'opening_control')]}"
  23. icon="fa-money"
  24. type="object" context="{'balance': 'start'}">
  25. <span class="o_stat_text">Set Opening Balance</span>
  26. </button>
  27. </xpath>
  28. <!-- Hide closing button -->
  29. <xpath expr="//button[@name='open_cashbox']" position="replace">
  30. </xpath>
  31. <!-- Add new session button on closing-->
  32. <xpath expr="//header" position="inside">
  33. <button name="action_pos_session_new_session" type="object"
  34. string="New Session" class="oe_highlight"
  35. attrs="{'invisible' : [('state', '!=', 'closed')]}"/>
  36. </xpath>
  37. <!-- Theoritical Summary -->
  38. <xpath expr="//field[@name='cash_register_balance_start']/.." position="attributes">
  39. <attribute name="invisible">1</attribute>
  40. </xpath>
  41. <xpath expr="//field[@name='cash_register_balance_start']/.." position="after">
  42. <group class="oe_subtotal_footer oe_right">
  43. <field name="control_register_balance_start" readonly="1" class="oe_subtotal_footer_separator" widget="monetary" options="{'currency_field': 'currency_id'}"/>
  44. <label for="control_register_total_entry_encoding" attrs="{'invisible' : [('state', '=', 'opening_control')]}" string="+ Transactions" class="oe_opening_total"/>
  45. <field name="control_register_total_entry_encoding" nolabel="1" attrs="{'invisible' : [('state', '=', 'opening_control')]}" class="oe_pos_total" widget="monetary" options="{'currency_field': 'currency_id'}"/>
  46. <label for="control_register_balance_end" attrs="{'invisible' : [('state', '=', 'opening_control')]}" string="Theoretical Closing Balances" class="oe_opening_total"/>
  47. <field name="control_register_balance_end" nolabel="1" attrs="{'invisible' : [('state', '=', 'opening_control')]}" class="oe_subtotal_footer_separator" widget="monetary" options="{'currency_field': 'currency_id'}"/>
  48. </group>
  49. </xpath>
  50. <!-- Real Summary and Differences -->
  51. <xpath expr="//field[@name='cash_register_balance_end_real']/../.." position="replace">
  52. <div>
  53. <group/>
  54. <group class="oe_subtotal_footer oe_right" attrs="{'invisible': ['|', ('cash_control', '=', False), ('state', '=', 'opening_control')]}">
  55. <field name="control_register_balance" string="Real Closing Balance" class="oe_subtotal_footer_separator" widget="monetary" options="{'currency_field': 'currency_id'}"/>
  56. <field name="control_register_difference" class="oe_subtotal_footer_separator oe_right oe_pos_total oe_pos_difference" widget="monetary" options="{'currency_field': 'currency_id'}"/>
  57. </group>
  58. </div>
  59. </xpath>
  60. <!-- Summary by Payment Methods -->
  61. <field name="statement_ids" position="attributes">
  62. <attribute name="invisible">1</attribute>
  63. </field>
  64. <field name="statement_ids" position="after">
  65. <field name="summary_statement_ids" nolabel="1" colspan="4"
  66. attrs="{'invisible': [('state', 'in', ['opening_control'])], 'readonly': 1}">
  67. <tree decoration-muted="is_pos_control == False and state != 'closed'" decoration-danger="is_pos_control == True and control_difference != 0">
  68. <field name="is_pos_control" invisible="1"/>
  69. <field name="name" />
  70. <field name="journal_id" />
  71. <field name="balance_start"/>
  72. <button name="open_cashbox_starting_balance"
  73. help="Set your starting balance"
  74. type="object"
  75. class="oe_stat_button" icon="fa-money"
  76. attrs="{'invisible' : ['|', ('is_pos_control','!=', True), ('state', 'in', ['opening_control','closed'])]}">
  77. </button>
  78. <field name="total_entry_encoding" />
  79. <field name="balance_end_real"/>
  80. <button name="open_cashbox_ending_balance"
  81. help="Set your ending balance"
  82. type="object"
  83. class="oe_stat_button" icon="fa-money"
  84. attrs="{'invisible' : ['|', ('is_pos_control','!=', True), ('state', 'in', ['opening_control', 'closed'])]}">
  85. </button>
  86. <field name="control_difference"/>
  87. <field name="currency_id" groups="base.group_multi_currency" />
  88. <field name="state" invisible="1"/>
  89. </tree>
  90. <form>
  91. <group>
  92. <field name="name" />
  93. <field name="journal_id" />
  94. <field name="state" invisible="1" />
  95. </group>
  96. <field name="line_ids" colspan="2">
  97. <tree string="Transactions">
  98. <field name="date"/>
  99. <field name="ref"/>
  100. <field name="name"/>
  101. <field name="partner_id" />
  102. <field name="amount" sum="Total"/>
  103. </tree>
  104. </field>
  105. </form>
  106. </field>
  107. </field>
  108. <!-- Automatic solve -->
  109. <field name="control_difference" position="after">
  110. <field name="pos_session_state" invisible="1"/>
  111. <field name="display_autosolve" invisible="1"/>
  112. </field>
  113. <field name="control_difference" position="after">
  114. <button name="automatic_solve"
  115. help="Solve difference automatically with a product choosen in pos config"
  116. type="object"
  117. class="oe_stat_button" icon="fa-cogs"
  118. confirm="Do you really want to solve this difference automatically ?"
  119. attrs="{'invisible':[
  120. ('display_autosolve', '!=', True)]}">
  121. </button>
  122. </field>
  123. </field>
  124. </record>
  125. </odoo>