[MERGE] account: cash register view improvements

- now looking like cash control methods from the point of sale module.

point of sale: improved some tooltips + cash control form view improvements

bzr revid: tde@openerp.com-20140102113009-lb1vv2w3g4dz2oqw
This commit is contained in:
Thibault Delavallée 2014-01-02 12:30:09 +01:00
commit 737be08fbf
8 changed files with 177 additions and 78 deletions

View File

@ -135,7 +135,8 @@ for a particular financial year and for preparation of vouchers there is a modul
], ],
'css':[ 'css':[
'static/src/css/account_move_reconciliation.css', 'static/src/css/account_move_reconciliation.css',
'static/src/css/account_move_line_quickadd.css' 'static/src/css/account_move_line_quickadd.css',
'static/src/css/account_bank_and_cash.css',
], ],
'demo': [ 'demo': [
'demo/account_demo.xml', 'demo/account_demo.xml',

View File

@ -106,13 +106,13 @@ class account_bank_statement(osv.osv):
'balance_start': fields.float('Starting Balance', digits_compute=dp.get_precision('Account'), 'balance_start': fields.float('Starting Balance', digits_compute=dp.get_precision('Account'),
states={'confirm':[('readonly',True)]}), states={'confirm':[('readonly',True)]}),
'balance_end_real': fields.float('Ending Balance', digits_compute=dp.get_precision('Account'), 'balance_end_real': fields.float('Ending Balance', digits_compute=dp.get_precision('Account'),
states={'confirm': [('readonly', True)]}), states={'confirm': [('readonly', True)]}, help="Computed using the cash control lines"),
'balance_end': fields.function(_end_balance, 'balance_end': fields.function(_end_balance,
store = { store = {
'account.bank.statement': (lambda self, cr, uid, ids, c={}: ids, ['line_ids','move_line_ids','balance_start'], 10), 'account.bank.statement': (lambda self, cr, uid, ids, c={}: ids, ['line_ids','move_line_ids','balance_start'], 10),
'account.bank.statement.line': (_get_statement, ['amount'], 10), 'account.bank.statement.line': (_get_statement, ['amount'], 10),
}, },
string="Computed Balance", help='Balance as calculated based on Starting Balance and transaction lines'), string="Computed Balance", help='Balance as calculated based on Opening Balance and transaction lines'),
'company_id': fields.related('journal_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True, readonly=True), 'company_id': fields.related('journal_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True, readonly=True),
'line_ids': fields.one2many('account.bank.statement.line', 'line_ids': fields.one2many('account.bank.statement.line',
'statement_id', 'Statement lines', 'statement_id', 'Statement lines',
@ -128,6 +128,7 @@ class account_bank_statement(osv.osv):
'currency': fields.function(_currency, string='Currency', 'currency': fields.function(_currency, string='Currency',
type='many2one', relation='res.currency'), type='many2one', relation='res.currency'),
'account_id': fields.related('journal_id', 'default_debit_account_id', type='many2one', relation='account.account', string='Account used in this journal', readonly=True, help='used in statement reconciliation domain, but shouldn\'t be used elswhere.'), 'account_id': fields.related('journal_id', 'default_debit_account_id', type='many2one', relation='account.account', string='Account used in this journal', readonly=True, help='used in statement reconciliation domain, but shouldn\'t be used elswhere.'),
'cash_control': fields.related('journal_id', 'cash_control' , type='boolean', relation='account.journal',string='Cash control'),
} }
_defaults = { _defaults = {
@ -450,22 +451,25 @@ class account_bank_statement(osv.osv):
def _compute_balance_end_real(self, cr, uid, journal_id, context=None): def _compute_balance_end_real(self, cr, uid, journal_id, context=None):
res = False res = False
if journal_id: if journal_id:
cr.execute('SELECT balance_end_real \ journal = self.pool.get('account.journal').browse(cr, uid, journal_id, context=context)
FROM account_bank_statement \ if journal.with_last_closing_balance:
WHERE journal_id = %s AND NOT state = %s \ cr.execute('SELECT balance_end_real \
ORDER BY date DESC,id DESC LIMIT 1', (journal_id, 'draft')) FROM account_bank_statement \
res = cr.fetchone() WHERE journal_id = %s AND NOT state = %s \
ORDER BY date DESC,id DESC LIMIT 1', (journal_id, 'draft'))
res = cr.fetchone()
return res and res[0] or 0.0 return res and res[0] or 0.0
def onchange_journal_id(self, cr, uid, statement_id, journal_id, context=None): def onchange_journal_id(self, cr, uid, statement_id, journal_id, context=None):
if not journal_id: if not journal_id:
return {} return {}
balance_start = self._compute_balance_end_real(cr, uid, journal_id, context=context) balance_start = self._compute_balance_end_real(cr, uid, journal_id, context=context)
journal = self.pool.get('account.journal').browse(cr, uid, journal_id, context=context)
journal_data = self.pool.get('account.journal').read(cr, uid, journal_id, ['company_id', 'currency'], context=context) currency = journal.currency or journal.company_id.currency_id
company_id = journal_data['company_id'] res = {'balance_start': balance_start, 'company_id': journal.company_id.id, 'currency': currency.id}
currency_id = journal_data['currency'] or self.pool.get('res.company').browse(cr, uid, company_id[0], context=context).currency_id.id if journal.type == 'cash':
return {'value': {'balance_start': balance_start, 'company_id': company_id, 'currency': currency_id}} res['cash_control'] = journal.cash_control
return {'value': res}
def unlink(self, cr, uid, ids, context=None): def unlink(self, cr, uid, ids, context=None):
stat = self.read(cr, uid, ids, ['state'], context=context) stat = self.read(cr, uid, ids, ['state'], context=context)
@ -546,7 +550,7 @@ class account_bank_statement_line(osv.osv):
_name = "account.bank.statement.line" _name = "account.bank.statement.line"
_description = "Bank Statement Line" _description = "Bank Statement Line"
_columns = { _columns = {
'name': fields.char('OBI', required=True, help="Originator to Beneficiary Information"), 'name': fields.char('Description', required=True),
'date': fields.date('Date', required=True), 'date': fields.date('Date', required=True),
'amount': fields.float('Amount', digits_compute=dp.get_precision('Account')), 'amount': fields.float('Amount', digits_compute=dp.get_precision('Account')),
'type': fields.selection([ 'type': fields.selection([

View File

@ -159,6 +159,10 @@ class account_cash_statement(osv.osv):
context=context context=context
) )
opening_details_ids = self._get_cash_open_box_lines(cr, uid, journal_id, context)
if opening_details_ids:
result['value']['opening_details_ids'] = opening_details_ids
if not statement_ids: if not statement_ids:
return result return result
@ -172,13 +176,14 @@ class account_cash_statement(osv.osv):
store = { store = {
'account.bank.statement': (lambda self, cr, uid, ids, context=None: ids, ['line_ids','move_line_ids'], 10), 'account.bank.statement': (lambda self, cr, uid, ids, context=None: ids, ['line_ids','move_line_ids'], 10),
'account.bank.statement.line': (_get_statement_from_line, ['amount'], 10), 'account.bank.statement.line': (_get_statement_from_line, ['amount'], 10),
}), },
help="Total of cash transaction lines."),
'closing_date': fields.datetime("Closed On"), 'closing_date': fields.datetime("Closed On"),
'details_ids' : fields.one2many('account.cashbox.line', 'bank_statement_id', string='CashBox Lines'), 'details_ids' : fields.one2many('account.cashbox.line', 'bank_statement_id', string='CashBox Lines'),
'opening_details_ids' : fields.one2many('account.cashbox.line', 'bank_statement_id', string='Opening Cashbox Lines'), 'opening_details_ids' : fields.one2many('account.cashbox.line', 'bank_statement_id', string='Opening Cashbox Lines'),
'closing_details_ids' : fields.one2many('account.cashbox.line', 'bank_statement_id', string='Closing Cashbox Lines'), 'closing_details_ids' : fields.one2many('account.cashbox.line', 'bank_statement_id', string='Closing Cashbox Lines'),
'user_id': fields.many2one('res.users', 'Responsible', required=False), 'user_id': fields.many2one('res.users', 'Responsible', required=False),
'difference' : fields.function(_compute_difference, method=True, string="Difference", type="float"), 'difference' : fields.function(_compute_difference, method=True, string="Difference", type="float", help="Difference between the theoretical closing balance and the real closing balance."),
'last_closing_balance' : fields.function(_compute_last_closing_balance, method=True, string='Last Closing Balance', type='float'), 'last_closing_balance' : fields.function(_compute_last_closing_balance, method=True, string='Last Closing Balance', type='float'),
} }
_defaults = { _defaults = {
@ -187,13 +192,12 @@ class account_cash_statement(osv.osv):
'user_id': lambda self, cr, uid, context=None: uid, 'user_id': lambda self, cr, uid, context=None: uid,
} }
def create(self, cr, uid, vals, context=None): def _get_cash_open_box_lines(self, cr, uid, journal_id, context):
journal = False details_ids = []
if vals.get('journal_id'): if not journal_id:
journal = self.pool.get('account.journal').browse(cr, uid, vals['journal_id'], context=context) return details_ids
if journal and (journal.type == 'cash') and not vals.get('details_ids'): journal = self.pool.get('account.journal').browse(cr, uid, journal_id, context=context)
vals['details_ids'] = [] if journal and (journal.type == 'cash'):
last_pieces = None last_pieces = None
if journal.with_last_closing_balance == True: if journal.with_last_closing_balance == True:
@ -206,16 +210,19 @@ class account_cash_statement(osv.osv):
last_pieces = dict( last_pieces = dict(
(line.pieces, line.number_closing) for line in last_bank_statement.details_ids (line.pieces, line.number_closing) for line in last_bank_statement.details_ids
) )
for value in journal.cashbox_line_ids: for value in journal.cashbox_line_ids:
nested_values = { nested_values = {
'number_closing' : 0, 'number_closing' : 0,
'number_opening' : last_pieces.get(value.pieces, 0) if isinstance(last_pieces, dict) else 0, 'number_opening' : last_pieces.get(value.pieces, 0) if isinstance(last_pieces, dict) else 0,
'pieces' : value.pieces 'pieces' : value.pieces
} }
details_ids.append([0, False, nested_values])
return details_ids
vals['details_ids'].append([0, False, nested_values]) def create(self, cr, uid, vals, context=None):
journal_id = vals.get('journal_id')
if journal_id and not vals.get('opening_details_ids'):
vals['opening_details_ids'] = vals.get('opening_details_ids') or self._get_cash_open_box_lines(cr, uid, journal_id, context)
res_id = super(account_cash_statement, self).create(cr, uid, vals, context=context) res_id = super(account_cash_statement, self).create(cr, uid, vals, context=context)
self._update_balances(cr, uid, [res_id], context) self._update_balances(cr, uid, [res_id], context)
return res_id return res_id
@ -233,7 +240,10 @@ class account_cash_statement(osv.osv):
@return: True on success, False otherwise @return: True on success, False otherwise
""" """
if vals.get('journal_id', False):
cashbox_line_obj = self.pool.get('account.cashbox.line')
cashbox_ids = cashbox_line_obj.search(cr, uid, [('bank_statement_id', 'in', ids)], context=context)
cashbox_line_obj.unlink(cr, uid, cashbox_ids, context)
res = super(account_cash_statement, self).write(cr, uid, ids, vals, context=context) res = super(account_cash_statement, self).write(cr, uid, ids, vals, context=context)
self._update_balances(cr, uid, ids, context) self._update_balances(cr, uid, ids, context)
return res return res

View File

@ -2264,7 +2264,6 @@
<group> <group>
<field name="journal_id" on_change="onchange_journal_id(journal_id)" widget="selection" domain="[('type', '=', 'cash')]" /> <field name="journal_id" on_change="onchange_journal_id(journal_id)" widget="selection" domain="[('type', '=', 'cash')]" />
<field name="user_id" readonly="1" string="Responsible"/> <field name="user_id" readonly="1" string="Responsible"/>
<field name="total_entry_encoding"/>
<field name='company_id' widget="selection" groups="base.group_multi_company" /> <field name='company_id' widget="selection" groups="base.group_multi_company" />
</group> </group>
<group> <group>
@ -2272,6 +2271,7 @@
<field name="closing_date" readonly="1"/> <field name="closing_date" readonly="1"/>
<field name="period_id" class="oe_inline"/> <field name="period_id" class="oe_inline"/>
<field name="currency" invisible="1"/> <field name="currency" invisible="1"/>
<field name="cash_control" invisible="1"/>
</group> </group>
</group> </group>
<notebook> <notebook>
@ -2305,41 +2305,64 @@
</form> </form>
</field> </field>
</page> </page>
<page string="Cash Control"> <page string="Cash Control" attrs="{'invisible' : [('cash_control', '=', False)]}">
<group col="2" expand="1"> <group col="2" expand="1">
<field name="opening_details_ids" nolabel="1" colspan="4" attrs="{'invisible' : [('state', '!=', 'draft')]}"> <group string="Opening Cash Control" attrs="{'invisible' : [('state', '!=', 'draft')]}">
<tree string="Opening Cashbox Lines" editable="bottom"> <field name="opening_details_ids" colspan="2" nolabel="1">
<field name="pieces"/> <tree string="Opening Cashbox Lines" editable="bottom">
<field name="number_opening" string="Opening Unit Numbers" on_change="on_change_sub_opening(pieces, number_opening, parent.balance_end)"/> <field name="pieces"/>
<field name="subtotal_opening" string="Opening Subtotal"/> <field name="number_opening" on_change="on_change_sub_opening(pieces, number_opening)" />
</tree> <field name="subtotal_opening" string="Opening Subtotal" sum="Total"/>
</field> </tree>
<field name="closing_details_ids" nolabel="1" colspan="4" attrs="{'invisible' : [('state', '=', 'draft')]}"> </field>
<tree string="Closing Cashbox Lines" editable="bottom"> </group>
<field name="pieces" readonly="1" /> <group>
<field name="number_opening" string="Opening Unit Numbers" readonly="1" /> <group string="Opening Cash Control" attrs="{'invisible' : [('state', '=', 'draft')]}">
<field name="subtotal_opening" string="Opening Subtotal" readonly="1" /> <field name="details_ids" colspan="2" nolabel="1" attrs="{'readonly' : [('state', '!=', 'draft')]}">
<tree string="Opening Cashbox Lines" editable="bottom">
<field name="number_closing" string="Closing Unit Numbers" on_change="on_change_sub_closing(pieces, number_closing, parent.balance_end)"/> <field name="pieces"/>
<field name="subtotal_closing" string="Closing Subtotal"/> <field name="number_opening" on_change="on_change_sub_opening(pieces, number_opening)"/>
</tree> <field name="subtotal_opening" string="Opening Subtotal" sum="Total"/>
</field> </tree>
</field>
</group>
<group string="Closing Cash Control" attrs="{'invisible' : [('state', '=', 'draft')]}">
<field name="closing_details_ids" colspan="2" nolabel="1" attrs="{'readonly' : [('state', '=', 'confirm')]}">
<tree string="Closing Cashbox Lines" editable="bottom">
<field name="pieces" readonly="1" />
<field name="number_closing" on_change="on_change_sub_closing(pieces, number_closing)"/>
<field name="subtotal_closing" string="Closing Subtotal" sum="Total"/>
</tree>
</field>
</group>
</group>
</group> </group>
</page> </page>
<page string="Journal Entries" attrs="{'invisible': [('state','!=','confirm')]}"> <page string="Journal Entries" attrs="{'invisible': [('state','!=','confirm')]}">
<field name="move_line_ids" string="Journal Entries"/> <field name="move_line_ids" string="Journal Entries"/>
</page> </page>
</notebook> </notebook>
<group col="6" colspan="4"> <group>
<group col="2" colspan="2"> <group class="oe_subtotal_footer oe_right">
<separator string="Opening Balance" colspan="4"/> <label for="balance_start" class="oe_subtotal_footer_separator oe_open_balance" string="Opening Balance" style="padding-right: 23px !important; padding-top: 6px !important;"/>
<field name="balance_start" readonly="1" string="Opening Cash Control" widget="monetary" options="{'currency_field': 'currency_id'}"/> <field name="balance_start" attrs="{'readonly' : ['|', ('cash_control', '=', True), ('state', '=', 'confirm')]}" nolabel="1" widget="monetary" class="oe_subtotal_footer_separator oe_open_balance" options="{'currency_field': 'currency'}" help="Total of opening cash control lines"/>
<field name="last_closing_balance" readonly="1" string="Last Closing Balance" widget="monetary" options="{'currency_field': 'currency_id'}"/> <label for="total_entry_encoding" string="+ Transactions" class="oe_force_bold oe_mini_subtotal_footer_separator" style="padding-right: 20px !important;"/>
<field name="total_entry_encoding" widget="monetary" options="{'currency_field': 'currency_id'}"/> <field name="total_entry_encoding" nolabel="1" class="oe_bold oe_account_total" widget="monetary" options="{'currency_field': 'currency'}"/>
</group> <label for="balance_end" string="= Theoretical Closing Balance" class="oe_force_bold oe_mini_subtotal_footer_separator" style="padding-right: 20px !important;" help="Sum of opening balance and transactions."/>
<group string="Closing Balance"> <field name="balance_end" nolabel="1" class="oe_bold oe_account_total" widget="monetary" options="{'currency_field': 'currency'}"/>
<field name="balance_end" widget="monetary" options="{'currency_field': 'currency_id'}"/>
</group> </group>
<div>
<group class="oe_subtotal_footer oe_right" attrs="{'invisible': [('state', '=', 'draft')]}">
<label for="balance_end_real" class="oe_subtotal_footer_separator oe_real_closing_balance" string="Real Closing Balance" style="padding-right: 23px !important; padding-top: 6px !important;"/>
<field name="balance_end_real" attrs="{'readonly' : ['|', ('cash_control', '=', True), ('state', '=', 'confirm')]}" nolabel="1" class="oe_subtotal_footer_separator oe_real_closing_balance" widget="monetary" options="{'currency_field': 'currency'}" help="Total of closing cash control lines."/>
</group>
<group/>
<group/>
<group class="oe_subtotal_footer oe_right" attrs="{'invisible': [('state', '=', 'draft')]}">
<label for="difference" string="Difference" class="oe_subtotal_footer_separator oe_difference" style="padding-right: 20px !important;"/>
<field name="difference" nolabel="1" class="oe_subtotal_footer_separator oe_difference" widget="monetary" options="{'currency_field': 'currency'}"/>
</group>
</div>
</group> </group>
</sheet> </sheet>
</form> </form>

View File

@ -0,0 +1,27 @@
.openerp .oe_force_bold {
font-weight: bold !important;
}
.openerp label.oe_open_balance{
margin-right: -18px;
}
.openerp label.oe_subtotal_footer_separator{
float:right;
width: 184px !important;
}
.openerp label.oe_mini_subtotal_footer_separator{
margin-right: -14px;
}
.openerp .oe_account_total, .openerp .oe_pos_total {
margin-left: -2px;
}
.openerp label.oe_real_closing_balance{
min-width: 184px !important;
}
.openerp label.oe_difference, .openerp label.oe_pos_difference {
margin-right: -10px;
padding-left: 10px !important;
min-width: 195px !important;
}
.openerp .oe_opening_total{
margin-right: 4px;
}

View File

@ -270,6 +270,20 @@
</xpath> </xpath>
</field> </field>
</record> </record>
<record id="view_bank_statement_inherit_form2" model="ir.ui.view">
<field name="name">account.bank.statement.form.inherit</field>
<field name="model">account.bank.statement</field>
<field name="inherit_id" ref="account.view_bank_statement_form2"/>
<field name="arch" type="xml">
<xpath expr="/form/sheet/notebook/page/field[@name='line_ids']/tree/field[@name='analytic_account_id']" position="replace">
<field name="analytics_id" groups="analytic.group_analytic_accounting"/>
</xpath>
<xpath expr="/form/sheet/notebook/page/field[@name='line_ids']/form/group/field[@name='analytic_account_id']" position="replace">
<field name="analytics_id" groups="analytic.group_analytic_accounting"/>
</xpath>
</field>
</record>
</data> </data>
</openerp> </openerp>

View File

@ -45,6 +45,16 @@ class pos_config(osv.osv):
('deprecated', 'Deprecated') ('deprecated', 'Deprecated')
] ]
def _get_currency(self, cr, uid, ids, fieldnames, args, context=None):
result = dict.fromkeys(ids, False)
for pos_config in self.browse(cr, uid, ids, context=context):
if pos_config.journal_id:
currency_id = pos_config.journal_id.currency.id or pos_config.journal_id.company_id.currency_id.id
else:
currency_id = self.pool['res.users'].browse(cr, uid, uid, context=context).company_id.currency_id.id
result[pos_config.id] = currency_id
return result
_columns = { _columns = {
'name' : fields.char('Point of Sale Name', size=32, select=1, 'name' : fields.char('Point of Sale Name', size=32, select=1,
required=True, help="An internal identification of the point of sale"), required=True, help="An internal identification of the point of sale"),
@ -56,6 +66,7 @@ class pos_config(osv.osv):
'journal_id' : fields.many2one('account.journal', 'Sale Journal', 'journal_id' : fields.many2one('account.journal', 'Sale Journal',
domain=[('type', '=', 'sale')], domain=[('type', '=', 'sale')],
help="Accounting journal used to post sales entries."), help="Accounting journal used to post sales entries."),
'currency_id' : fields.function(_get_currency, type="many2one", string="Currency", relation="res.currency"),
'iface_self_checkout' : fields.boolean('Self Checkout Mode', 'iface_self_checkout' : fields.boolean('Self Checkout Mode',
help="Check this if this point of sale should open by default in a self checkout mode. If unchecked, OpenERP uses the normal cashier mode by default."), help="Check this if this point of sale should open by default in a self checkout mode. If unchecked, OpenERP uses the normal cashier mode by default."),
'iface_cashdrawer' : fields.boolean('Cashdrawer Interface'), 'iface_cashdrawer' : fields.boolean('Cashdrawer Interface'),
@ -202,6 +213,7 @@ class pos_session(osv.osv):
readonly=True, readonly=True,
states={'opening_control' : [('readonly', False)]} states={'opening_control' : [('readonly', False)]}
), ),
'currency_id' : fields.related('config_id', 'currency_id', type="many2one", relation='res.currency', string="Currnecy"),
'start_at' : fields.datetime('Opening Date', readonly=True), 'start_at' : fields.datetime('Opening Date', readonly=True),
'stop_at' : fields.datetime('Closing Date', readonly=True), 'stop_at' : fields.datetime('Closing Date', readonly=True),
@ -232,27 +244,28 @@ class pos_session(osv.osv):
type='float', type='float',
digits_compute=dp.get_precision('Account'), digits_compute=dp.get_precision('Account'),
string="Ending Balance", string="Ending Balance",
help="Computed using the cash control lines", help="Total of closing cash control lines.",
readonly=True), readonly=True),
'cash_register_balance_start' : fields.related('cash_register_id', 'balance_start', 'cash_register_balance_start' : fields.related('cash_register_id', 'balance_start',
type='float', type='float',
digits_compute=dp.get_precision('Account'), digits_compute=dp.get_precision('Account'),
string="Starting Balance", string="Starting Balance",
help="Computed using the cash control at the opening.", help="Total of opening cash control lines.",
readonly=True), readonly=True),
'cash_register_total_entry_encoding' : fields.related('cash_register_id', 'total_entry_encoding', 'cash_register_total_entry_encoding' : fields.related('cash_register_id', 'total_entry_encoding',
string='Total Cash Transaction', string='Total Cash Transaction',
readonly=True), readonly=True,
help="Total of all paid sale orders"),
'cash_register_balance_end' : fields.related('cash_register_id', 'balance_end', 'cash_register_balance_end' : fields.related('cash_register_id', 'balance_end',
type='float', type='float',
digits_compute=dp.get_precision('Account'), digits_compute=dp.get_precision('Account'),
string="Computed Balance", string="Theoretical Closing Balance",
help="Computed with the initial cash control and the sum of all payments.", help="Sum of opening balance and transactions.",
readonly=True), readonly=True),
'cash_register_difference' : fields.related('cash_register_id', 'difference', 'cash_register_difference' : fields.related('cash_register_id', 'difference',
type='float', type='float',
string='Difference', string='Difference',
help="Difference between the counted cash control at the closing and the computed balance.", help="Difference between the theoretical closing balance and the real closing balance.",
readonly=True), readonly=True),
'journal_ids' : fields.related('config_id', 'journal_ids', 'journal_ids' : fields.related('config_id', 'journal_ids',

View File

@ -772,6 +772,7 @@
<group col="4"> <group col="4">
<field name="warehouse_id" widget="selection" groups="stock.group_locations" /> <field name="warehouse_id" widget="selection" groups="stock.group_locations" />
<field name="pricelist_id" groups="product.group_sale_pricelist"/> <field name="pricelist_id" groups="product.group_sale_pricelist"/>
<field name="currency_id" invisible="1"/>
<field name="journal_id" widget="selection"/> <field name="journal_id" widget="selection"/>
<field name="group_by" groups="account.group_account_user"/> <field name="group_by" groups="account.group_account_user"/>
<field name="sequence_id" readonly="1" groups="base.group_no_one"/> <field name="sequence_id" readonly="1" groups="base.group_no_one"/>
@ -878,9 +879,9 @@
class="oe_highlight" /> class="oe_highlight" />
<button name="close" type="workflow" string="Validate Closing &amp; Post Entries" states="closing_control" <button name="close" type="workflow" string="Validate Closing &amp; Post Entries" states="closing_control"
class="oe_highlight" /> class="oe_highlight" />
<div class="oe_right">
<field name="state" widget="statusbar" statusbar_visible="opening_control,opened,closing_control,closed" nolabel="1" /> <field name="state" widget="statusbar" statusbar_visible="opening_control,opened,closing_control,closed" nolabel="1" />
</div>
</header> </header>
<sheet> <sheet>
<div class="oe_right oe_button_box"> <div class="oe_right oe_button_box">
@ -895,6 +896,7 @@
<field name="cash_control" invisible="1" /> <field name="cash_control" invisible="1" />
<group> <group>
<field name="user_id" context="{'default_groups_ref': ['base.group_user', 'base.group_partner_manager', 'point_of_sale.group_pos_manager', 'base.group_sale_manager']}"/> <field name="user_id" context="{'default_groups_ref': ['base.group_user', 'base.group_partner_manager', 'point_of_sale.group_pos_manager', 'base.group_sale_manager']}"/>
<field name="currency_id" invisible="1"/>
<field name="config_id"/> <field name="config_id"/>
</group> </group>
<group> <group>
@ -903,7 +905,7 @@
</group> </group>
<newline/> <newline/>
<group string="Opening Cash Control" attrs="{'invisible' : [('cash_control', '=', False)]}"> <group string="Opening Cash Control" attrs="{'invisible' : [('cash_control', '=', False)]}">
<field name="opening_details_ids" nolabel="1" colspan="2" attrs="{'readonly' : [('state', 'not in', ('opening_control',))]}"> <field name="opening_details_ids" nolabel="1" colspan="2" attrs="{'readonly' : [('state', '!=', 'opening_control')]}">
<tree string="Opening Cashbox Lines" editable="bottom"> <tree string="Opening Cashbox Lines" editable="bottom">
<field name="pieces" readonly="1" /> <field name="pieces" readonly="1" />
<field name="number_opening" on_change="on_change_sub_opening(pieces, number_opening)" /> <field name="number_opening" on_change="on_change_sub_opening(pieces, number_opening)" />
@ -912,20 +914,22 @@
</field> </field>
</group> </group>
<group string="Closing Cash Control" attrs="{'invisible': ['|', ('cash_control', '=', False), ('state', '=', 'opening_control')]}"> <group string="Closing Cash Control" attrs="{'invisible': ['|', ('cash_control', '=', False), ('state', '=', 'opening_control')]}">
<field name="details_ids" nolabel="1" colspan="2"> <field name="details_ids" nolabel="1" colspan="2" attrs="{'readonly' : [('state', '=', 'closed')]}">
<tree string="Cashbox Lines" editable="bottom"> <tree string="Cashbox Lines" editable="bottom">
<field name="pieces" readonly="1" /> <field name="pieces" readonly="1" />
<field name="number_closing" /> <field name="number_closing" on_change="on_change_sub_closing(pieces, number_closing)"/>
<field name="subtotal_closing"/> <field name="subtotal_closing" string="Closing Subtotal" sum="Total"/>
</tree> </tree>
</field> </field>
</group> </group>
<div attrs="{'invisible' : [('cash_control', '=', False)]}"> <div attrs="{'invisible' : [('cash_control', '=', False)]}">
<group class="oe_subtotal_footer oe_right"> <group class="oe_subtotal_footer oe_right">
<field name="cash_register_balance_start" readonly="1" string="Opening Balance" class="oe_subtotal_footer_separator"/> <field name="cash_register_balance_start" readonly="1" string="Opening Balance" class="oe_subtotal_footer_separator" widget="monetary" options="{'currency_field': 'currency_id'}"/>
<field name="cash_register_total_entry_encoding" attrs="{'invisible' : [('state', '=', 'opening_control')]}" string="+ Transactions"/> <label for="cash_register_total_entry_encoding" attrs="{'invisible' : [('state', '=', 'opening_control')]}" string="+ Transactions" class="oe_force_bold oe_opening_total"/>
<field name="cash_register_balance_end" attrs="{'invisible' : [('state', '=', 'opening_control')]}" string="= Theoretical Balance"/> <field name="cash_register_total_entry_encoding" nolabel="1" attrs="{'invisible' : [('state', '=', 'opening_control')]}" class="oe_bold oe_pos_total" widget="monetary" options="{'currency_field': 'currency_id'}"/>
<label for="cash_register_balance_end" attrs="{'invisible' : [('state', '=', 'opening_control')]}" string="= Theoretical Closing Balance" class="oe_force_bold oe_opening_total"/>
<field name="cash_register_balance_end" nolabel="1" attrs="{'invisible' : [('state', '=', 'opening_control')]}" class="oe_bold oe_pos_total" widget="monetary" options="{'currency_field': 'currency_id'}"/>
</group> </group>
<div class="oe_clear"/> <div class="oe_clear"/>
<div attrs="{'invisible' : ['|', ('cash_journal_id', '=', False), ('state', '!=', 'opening_control')]}" class="oe_view_nocontent" groups="point_of_sale.group_pos_manager"> <div attrs="{'invisible' : ['|', ('cash_journal_id', '=', False), ('state', '!=', 'opening_control')]}" class="oe_view_nocontent" groups="point_of_sale.group_pos_manager">
@ -936,14 +940,17 @@
</p> </p>
</div> </div>
</div> </div>
<div>
<group class="oe_subtotal_footer oe_right" attrs="{'invisible': ['|', ('cash_control', '=', False), ('state', '=', 'opening_control')]}">
<group class="oe_subtotal_footer oe_right" attrs="{'invisible': ['|', ('cash_control', '=', False), ('state', '=', 'opening_control')]}"> <field name="cash_register_balance_end_real" string="Real Closing Balance" class="oe_subtotal_footer_separator" widget="monetary" options="{'currency_field': 'currency_id'}"/>
<field name="cash_register_balance_end_real" class="oe_subtotal_footer_separator"/> </group>
<field name="cash_register_difference" class="oe_subtotal_footer_separator"/> <group/>
</group> <group/>
<group class="oe_subtotal_footer oe_right" attrs="{'invisible': ['|', ('cash_control', '=', False), ('state', '=', 'opening_control')]}">
<field name="cash_register_difference" class="oe_subtotal_footer_separator oe_right oe_pos_total oe_pos_difference" widget="monetary" options="{'currency_field': 'currency_id'}"/>
</group>
</div>
</group> </group>
<separator string="Summary by Payment Methods" attrs="{'invisible' : [('state', '=', 'opening_control')]}"/> <separator string="Summary by Payment Methods" attrs="{'invisible' : [('state', '=', 'opening_control')]}"/>
<field name="statement_ids" attrs="{'invisible' : [('state', '=', 'opening_control')]}"> <field name="statement_ids" attrs="{'invisible' : [('state', '=', 'opening_control')]}">
<tree string="Statements"> <tree string="Statements">