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

<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2017 - Today: GRAP (http://www.grap.coop)
@author Sylvain LE GAL (https://twitter.com/legalsylvain)
@author Quentin DUPONT (https://twitter.com/pondupont)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
-->
<odoo>
<record id="view_pos_session_form" model="ir.ui.view">
<field name="model">pos.session</field>
<field name="inherit_id" ref="point_of_sale.view_pos_session_form"/>
<field name="arch" type="xml">
<!-- Improve views -->
<field name="config_id" position="attributes">
<attribute name="readonly">1</attribute>
</field>
<!-- Hide obsolete Buttons -->
<!-- Same name button for opening and closing.. -->
<xpath expr="//button[@name='open_cashbox']" position="replace">
<button name="open_cashbox_opening"
class="oe_stat_button"
attrs="{'invisible':['|', ('cash_control', '=', False), ('state', '!=', 'opening_control')]}"
icon="fa-money"
type="object" context="{'balance': 'start'}">
<span class="o_stat_text">Set Opening Balance</span>
</button>
</xpath>
<!-- Hide closing button -->
<xpath expr="//button[@name='open_cashbox']" position="replace">
</xpath>
<!-- Add new session button on closing-->
<xpath expr="//header" position="inside">
<button name="action_pos_session_new_session" type="object"
string="New Session" class="oe_highlight"
attrs="{'invisible' : [('state', '!=', 'closed')]}"/>
</xpath>
<!-- Theoritical Summary -->
<xpath expr="//field[@name='cash_register_balance_start']/.." position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//field[@name='cash_register_balance_start']/.." position="after">
<group class="oe_subtotal_footer oe_right">
<field name="control_register_balance_start" readonly="1" class="oe_subtotal_footer_separator" widget="monetary" options="{'currency_field': 'currency_id'}"/>
<label for="control_register_total_entry_encoding" attrs="{'invisible' : [('state', '=', 'opening_control')]}" string="+ Transactions" class="oe_opening_total"/>
<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'}"/>
<label for="control_register_balance_end" attrs="{'invisible' : [('state', '=', 'opening_control')]}" string="Theoretical Closing Balances" class="oe_opening_total"/>
<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'}"/>
</group>
</xpath>
<!-- Real Summary and Differences -->
<xpath expr="//field[@name='cash_register_balance_end_real']/../.." position="replace">
<div>
<group/>
<group class="oe_subtotal_footer oe_right" attrs="{'invisible': ['|', ('cash_control', '=', False), ('state', '=', 'opening_control')]}">
<field name="control_register_balance" string="Real Closing Balance" class="oe_subtotal_footer_separator" widget="monetary" options="{'currency_field': 'currency_id'}"/>
<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'}"/>
</group>
</div>
</xpath>
<!-- Summary by Payment Methods -->
<field name="statement_ids" position="attributes">
<attribute name="invisible">1</attribute>
</field>
<field name="statement_ids" position="after">
<field name="summary_statement_ids" nolabel="1" colspan="4"
attrs="{'invisible': [('state', 'in', ['opening_control'])], 'readonly': 1}">
<tree decoration-muted="is_pos_control == False and state != 'closed'" decoration-danger="is_pos_control == True and control_difference != 0">
<field name="is_pos_control" invisible="1"/>
<field name="name" />
<field name="journal_id" />
<field name="balance_start"/>
<button name="open_cashbox_starting_balance"
help="Set your starting balance"
type="object"
class="oe_stat_button" icon="fa-money"
attrs="{'invisible' : ['|', ('is_pos_control','!=', True), ('state', 'in', ['opening_control','closed'])]}">
</button>
<field name="total_entry_encoding" />
<field name="balance_end_real"/>
<button name="open_cashbox_ending_balance"
help="Set your ending balance"
type="object"
class="oe_stat_button" icon="fa-money"
attrs="{'invisible' : ['|', ('is_pos_control','!=', True), ('state', 'in', ['opening_control', 'closed'])]}">
</button>
<field name="control_difference"/>
<field name="currency_id" groups="base.group_multi_currency" />
<field name="state" invisible="1"/>
</tree>
<form>
<group>
<field name="name" />
<field name="journal_id" />
<field name="state" invisible="1" />
</group>
<field name="line_ids" colspan="2">
<tree string="Transactions">
<field name="date"/>
<field name="ref"/>
<field name="name"/>
<field name="partner_id" />
<field name="amount" sum="Total"/>
</tree>
</field>
</form>
</field>
</field>
<!-- Automatic solve -->
<field name="control_difference" position="after">
<field name="pos_session_state" invisible="1"/>
<field name="display_autosolve" invisible="1"/>
</field>
<field name="control_difference" position="after">
<button name="automatic_solve"
help="Solve difference automatically with a product choosen in pos config"
type="object"
class="oe_stat_button" icon="fa-cogs"
confirm="Do you really want to solve this difference automatically ?"
attrs="{'invisible':[
('display_autosolve', '!=', True)]}">
</button>
</field>
</field>
</record>
</odoo>