[MOVE]: move cash statement to account

[FIX]: implement dependend code in pos related to the cashstatement

bzr revid: mga@tinyerp.com-20100628143754-r9f0x36oeixxuxjb
This commit is contained in:
Mantavya Gajjar
2010-06-28 20:07:54 +05:30
parent 09e9462aae
commit 49cea875bb
4 changed files with 66 additions and 714 deletions
+1 -1
View File
@@ -22,7 +22,7 @@
import pos
import account_bank_statement
import pos_account_bank_statement
#import pos_account_bank_statement
import wizard
import report
+18 -217
View File
@@ -20,13 +20,13 @@
#
##############################################################################
from osv import osv, fields
import time
from osv import osv
from osv import fields
from mx import DateTime
from decimal import Decimal
from tools.translate import _
class account_journal(osv.osv):
_inherit = 'account.journal'
@@ -34,231 +34,32 @@ class account_journal(osv.osv):
'auto_cash': fields.boolean('Automatic Opening', help="This field authorize the automatic creation of the cashbox"),
'special_journal':fields.boolean('Special Journal', help="Will put all the orders in waiting status till being accepted"),
'check_dtls': fields.boolean('Check Details', help="This field authorize Validation of Cashbox without checking ending details"),
'statement_sequence_id': fields.many2one('ir.sequence', 'Statement Sequence', \
help="The sequence used for statement numbers in this journal."),
'journal_users': fields.many2many('res.users','pos_journal_users','journal_id','user_id','Users'),
}
}
_defaults = {
'check_dtls': lambda *a:True,
'auto_cash': lambda *a:True,
}
}
account_journal()
class singer_statement(osv.osv):
""" Singer Statements """
_name = 'singer.statement'
_description = 'Statement'
def _sub_total(self, cr, uid, ids, name, arg, context=None):
""" Calculates Sub total"
@param name: Names of fields.
@param arg: User defined arguments
@return: Dictionary of values.
"""
res = {}
for obj in self.browse(cr, uid, ids):
res[obj.id] = obj.pieces * obj.number
return res
def on_change_sub(self, cr, uid, ids, pieces, number,*a):
""" Calculates Sub total on change of number
@param pieces: Names of fields.
@param number:
"""
sub=pieces*number
return {'value':{'subtotal': sub or 0.0}}
_columns = {
'pieces': fields.float('Values', digits=(16,2)),
'number': fields.integer('Number'),
'subtotal': fields.function(_sub_total, method=True, string='Sub Total', type='float',digits=(16,2)),
'starting_id': fields.many2one('account.bank.statement',ondelete='cascade'),
'ending_id': fields.many2one('account.bank.statement',ondelete='cascade'),
}
singer_statement()
class account_bank_statement(osv.osv):
class account_cash_statement(osv.osv):
_inherit = 'account.bank.statement'
def _get_starting_balance(self, cr, uid, ids, name, arg, context=None):
""" Find starting balance "
@param name: Names of fields.
@param arg: User defined arguments
@return: Dictionary of values.
"""
res ={}
for statement in self.browse(cr, uid, ids):
amount_total=0.0
for line in statement.starting_details_ids:
amount_total+= line.pieces * line.number
res[statement.id]=amount_total
return res
def _equal_balance(self, r, uid, ids, statement, context={}):
stmt = self.browse(cr, uid, ids[0])
def _get_sum_entry_encoding(self, cr, uid, ids, name, arg, context=None):
""" Find encoding total of statements "
@param name: Names of fields.
@param arg: User defined arguments
@return: Dictionary of values.
"""
res2={}
for statement in self.browse(cr, uid, ids):
encoding_total=0.0
for line in statement.line_ids:
encoding_total+= line.amount
res2[statement.id]=encoding_total
return res2
def _default_journal_id(self, cr, uid, context={}):
""" To get default journal for the object"
@param name: Names of fields.
@return: journal
"""
company_id = self.pool.get('res.users').browse(cr, uid, uid).company_id.id
journal = self.pool.get('account.journal').search(cr, uid, [('type', '=', 'cash'), ('auto_cash','=',False), ('company_id', '=', company_id)])
if journal:
return journal[0]
else:
if not stmt.check_dtls:
return True
if stmt.check_dtls and (statement.balance_end != statement.balance_end_cash):
return False
_columns = {
'journal_id': fields.many2one('account.journal', 'Journal', required=True),
'balance_start': fields.function(_get_starting_balance, method=True, string='Starting Balance', type='float',digits=(16,2)),
# 'balance_start': fields.float('Starting Balance',digits=(16,2)),
# 'balance_end': fields.float('Balance',digits=(16,2)),
'state': fields.selection([('draft', 'Draft'),('confirm', 'Close'),('open','Open')],
'State', required=True, states={'confirm': [('readonly', True)]}, readonly="1"),
'total_entry_encoding':fields.function(_get_sum_entry_encoding, method=True, string="Total of Entry encoding"),
'date':fields.datetime("Opening Date"),
'closing_date':fields.datetime("Closing Date"),
'starting_details_ids': fields.one2many('singer.statement', 'starting_id', string='Starting Details'),
'ending_details_ids': fields.one2many('singer.statement', 'ending_id', string='Ending Details'),
'name': fields.char('Name', size=64, required=True, readonly=True),
}
_defaults = {
'state': lambda *a: 'draft',
'name': lambda *a: '/',
'date': lambda *a:time.strftime("%Y-%m-%d %H:%M:%S"),
'journal_id': _default_journal_id,
}
def create(self, cr, uid, vals, context=None):
company_id = vals and vals.get('company_id',False)
if company_id:
open_jrnl = self.search(cr, uid, [('company_id', '=', vals['company_id']), ('journal_id', '=', vals['journal_id']), ('state', '=', 'open')])
if open_jrnl:
raise osv.except_osv('Error', u'Une caisse de type espèce est déjà ouverte')
if 'starting_details_ids' in vals:
vals['starting_details_ids'] = starting_details_ids = map(list, vals['starting_details_ids'])
for i in starting_details_ids:
if i and i[0] and i[1]:
i[0], i[1] = 0, 0
res = super(account_bank_statement, self).create(cr, uid, vals, context=context)
return res
def onchange_journal_id(self, cursor, user, statement_id, journal_id, context=None):
""" Changes balance start and starting details if journal_id changes"
@param statement_id: Changed statement_id
@param journal_id: Changed journal_id
@return: Dictionary of changed values
"""
id_s=[]
if not journal_id:
return {'value': {'balance_start': 0.0}}
balance_start=0.0
cash_obj = self.pool.get('singer.statement')
statement_obj = self.pool.get('account.bank.statement')
cursor.execute("Select a.id from account_bank_statement a where journal_id=%d and user_id=%d order by a.id desc limit 1"%(journal_id,user))
res2=cursor.fetchone()
res2=res2 and res2[0] or None
if res2:
statmt_id=statement_obj.browse(cursor,user,res2)
check_det=statmt_id.journal_id.check_dtls
if not check_det:
balance_start=statmt_id.balance_end_real or 0.0
return {'value': {'balance_start': balance_start}}
cursor.execute("Select a.id from account_bank_statement a, singer_statement s where journal_id=%d and user_id=%d order by a.id desc limit 1"%(journal_id,user))
res1=cursor.fetchone()
res1=res1 and res1[0] or None
if res1:
cursor.execute("Select sum(ss.pieces*ss.number),ss.ending_id from singer_statement ss, account_bank_statement s where ss.ending_id=s.id and s.journal_id=%d and s.user_id=%d and s.id=%d group by ss.ending_id,s.id order by s.id desc"%(journal_id,user, res1))
res = cursor.fetchone()
balance_start = res and res[0] or 0.0
cash_end=res and res[1] or None
id_s=statement_obj.browse(cursor,user,cash_end).ending_details_ids
new=[]
if id_s:
for s in id_s:
new.append(s.id)
return {'value': {'balance_start': balance_start, 'starting_details_ids':new}}
def button_open(self, cr, uid, ids, context=None):
""" Changes statement state to Running.
@return: True
"""
obj_inv = self.browse(cr, uid, ids)[0]
s_id=obj_inv.journal_id
if s_id.statement_sequence_id:
s_id=s_id.id
number = self.pool.get('ir.sequence').get_id(cr, uid, s_id)
else:
number = self.pool.get('ir.sequence').get(cr, uid,
'account.bank.statement')
self.write(cr, uid, ids, {'date':time.strftime("%Y-%m-%d %H:%M:%S"), 'state':'open', 'name':number})
return True
def button_confirm(self, cr, uid, ids, context={}):
""" Check the starting and ending detail of statement
@return: True
"""
val = 0.0
val2 = 0.0
val_statement_line = 0.0
diff = self.pool.get('res.users').browse(cr,uid,uid).company_id.max_diff or 0.0
for statement in self.browse(cr, uid, ids):
bal = statement.balance_end
bal_st=statement.balance_start
for st in statement.line_ids:
val_statement_line += st.amount
for stat in statement.starting_details_ids:
val2 += stat.subtotal
for stat in statement.ending_details_ids:
val += stat.subtotal
if statement.journal_id.check_dtls:
if Decimal(str(val)).quantize(Decimal('.001')) != (Decimal(str(val_statement_line)) + Decimal(str(val2))).quantize(Decimal('.001')):
raise osv.except_osv(_('Invalid action !'), _(' You can not confirm your cashbox, Please enter ending details, missing value matches to "%s"')%(abs(Decimal(str(val))-(Decimal(str(val_statement_line))+Decimal(str(val2))))))
self.write(cr, uid, statement.id, {'balance_end_real':Decimal(str(val_statement_line))+Decimal(str(val2)),'closing_date':time.strftime("%Y-%m-%d %H:%M:%S"),'state':'draft'})
# self.write(cr, uid, statement.id, {'balance_end_real':bal_st+val_statement_line,'closing_date':time.strftime("%Y-%m-%d %H:%M:%S"),'state':'draft'})
return super(account_bank_statement, self).button_confirm(cr, uid, ids, context={})
return True
def button_cancel(self, cr, uid, ids, context={}):
self.write(cr, uid, ids, {'state':'draft'}, context=context)
account_bank_statement()
#class singer_account_bank_statement_line(osv.osv):
# _inherit = 'account.bank.statement.line'
# _columns = {
# 'pos_statement_id': fields.many2one('pos.order',ondelete='cascade'),
# }
#
#singer_account_bank_statement_line()
def _user_allow(self, cr, uid, ids, statement, context={}):
res = False
print 'XXXXXXXXXXXXXXXXX : ', statement.journal_id.journal_users
return res
account_cash_statement()
@@ -20,21 +20,10 @@
#
##############################################################################
from osv import osv, fields
import time
import netsvc
class account_bank_statement(osv.osv):
_inherit = 'account.bank.statement'
_columns = {
'company_id':fields.many2one('res.company', 'Company', required=True),
}
_defaults = {
'company_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id,
}
account_bank_statement()
from osv import osv
from osv import fields
class account_bank_statement_line(osv.osv):
+45 -483
View File
@@ -1,505 +1,67 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record model="ir.ui.view" id="view_account_journal_form">
<field name="name">Journal</field>
<field name="model">account.journal</field>
<field name="type">form</field>
<field name="priority">10</field>
<field name="inherit_id" ref="account.view_account_journal_form"/>
<field name="arch" type="xml">
<field name="invoice_sequence_id" position="after">
<field name="statement_sequence_id"/>
<field name="auto_cash"/>
<!-- <field name="check_dtls"/>-->
<field name="special_journal"/>
</field>
</field>
</record>
<record model="ir.ui.view" id="view_account_journal_pos_user_form">
<record model="ir.ui.view" id="view_account_journal_pos_user_form">
<field name="name">POS Journal</field>
<field name="model">account.journal</field>
<field name="type">form</field>
<field name="inherit_id" ref="account.view_account_journal_form"/>
<field name="inherit_id" ref="view_account_journal_form"/>
<field name="arch" type="xml">
<xpath expr="//notebook[last()]" position="inside">
<page string="Point Of Sale">
<group cols="2" colspan="4">
<field name="check_dtls"/>
</group>
<separator colspan="4" string="Users"/>
<field name="journal_users" nolabel="1"/>
</page>
</xpath>
</field>
</record>
<!-- Bank Statement -->
<record id="view_bank_statement_tree" model="ir.ui.view">
<field name="name">account.bank.statement.tree</field>
<field name="model">account.bank.statement</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree colors="red:balance_end_real!=balance_end;blue:state=='draft' and (balance_end_real==balance_end);black:state in ('open');blue:state in ('draft')" string="Statement">
<field name="date"/>
<field name="name"/>
<field name="journal_id"/>
<field name="period_id"/>
<field name="balance_start"/>
<field name="balance_end_real"/>
<field name="balance_end"/>
<field name="user_id"/>
<field name="state"/>
<button type="object" string="Open" name="button_open" states="draft" icon="terp-camera_test"/>
<button type="object" string="Close" name="button_confirm" states="open" icon="terp-gtk-go-back-rtl"/>
<button type="object" string="Cancel" name="button_cancel" states="confirm" icon="terp-gtk-stop"/>
</tree>
</field>
</record>
<record id="view_bank_statement_form2" model="ir.ui.view">
<field name="name">account.bank.statement.form</field>
<field name="model">account.bank.statement</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Statement">
<field name="name" select="1"/>
<field name="user_id" select="1"/>
<field name="company_id" select="1" groups="base.group_multi_company"/>
<field name="journal_id" on_change="onchange_journal_id(journal_id)" domain="[('type','=','cash'),('auto_cash','=',False)]" select="1" />
<newline/>
<field name="date" select="1" attrs="{'readonly':[('state','!=','draft')]}"/>
<field name="closing_date" select="1" attrs="{'readonly':[('state','=','confirm')]}"/>
<field name="balance_start"/>
<field name="balance_end_real"/>
<notebook colspan="4">
<page string="Starting Details">
<field name="starting_details_ids" nolabel = "1" colspan="4">
<tree string = "Starting Details" editable="bottom">
<field name="pieces"/>
<field name="number" on_change="on_change_sub(pieces,number, parent.balance_end)"/>
<field name="subtotal" sum="Total"/>
</tree>
<form string = "Ending Details">
<field name="pieces"/>
<field name="number" on_change="on_change_sub(pieces,number, parent.balance_end)"/>
<field name="subtotal"/>
</form>
</field>
</page>
<page string="Ending Details">
<field name="ending_details_ids" nolabel = "1" colspan="4">
<tree string = "Ending Details" editable="bottom">
<field name="pieces"/>
<field name="number" on_change="on_change_sub(pieces,number, parent.balance_end)"/>
<field name="subtotal" sum="Total"/>
</tree>
<form string = "Ending Details">
<field name="pieces"/>
<field name="number" on_change="on_change_sub(pieces,number, parent.balance_end)"/>
<field name="subtotal"/>
</form>
</field>
</page>
<page string="Entry encoding">
<field colspan="4" name="line_ids" nolabel="1">
<tree editable="bottom" string="Statement lines">
<field name="name"/>
<field name="ref"/>
<field name="partner_id" on_change="onchange_partner_id(partner_id, type, parent.currency)"/>
<field name="amount"/>
</tree>
<form string="Statement lines">
<field name="partner_id" on_change="onchange_partner_id(partner_id, type, parent.currency)"/>
<field name="amount"/>
<field name="name"/>
<field name="ref"/>
<separator colspan="4" string="Notes"/>
<field colspan="4" name="note" nolabel="1"/>
</form>
</field>
</page>
</notebook>
<group col="7" colspan="4">
<field name="state" colspan="4"/>
<field name="total_entry_encoding"/>
<xpath expr="//notebook[last()]" position="inside">
<page string="Point of Sale">
<group col="6" colspan="4">
<separator colspan="6" string="Extended Configureation"/>
<field name="check_dtls"/>
<field name="auto_cash"/>
<field name="special_journal"/>
</group>
<group colspan="4">
<button name="button_dummy" states="draft" string="Compute"/>
<button name="button_confirm" states="open" string="Close CashBox" type="object"/>
<button name="button_open" states="draft" string="Open CashBox" type="object"/>
<button name="button_cancel" states="confirm" string="Cancel" type="object" groups="base.group_extended"/>
</group>
</form>
</field>
</record>
<record id="view_bank_statement_form1" model="ir.ui.view">
<field name="name">account.bank.statement.form</field>
<field name="model">account.bank.statement</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Statement">
<field name="name" select="1"/>
<field name="user_id" select="1"/>
<field name="company_id" select="1" groups="base.group_multi_company"/>
<field name="journal_id" on_change="onchange_journal_id(journal_id)" domain="[('type','=','cash')]" select="1" readonly="1"/>
<newline/>
<field name="date" select="1" attrs="{'readonly':[('state','!=','draft')]}"/>
<field name="closing_date" select="1" attrs="{'readonly':[('state','=','confirm')]}"/>
<field name="balance_start"/>
<field name="balance_end_real"/>
<notebook colspan="4">
<page string="Details">
<field name="ending_details_ids" nolabel = "1" colspan="4">
<tree string = "Ending Details" editable="bottom">
<field name="pieces"/>
<field name="number" on_change="on_change_sub(pieces,number, parent.balance_end)"/>
<field name="subtotal" sum="Total"/>
</tree>
<form string = "Ending Details">
<field name="pieces"/>
<field name="number" on_change="on_change_sub(pieces,number, parent.balance_end)"/>
<field name="subtotal"/>
</form>
</field>
<separator colspan="4" string="Users"/>
<field name="journal_users" nolabel="1" colspan="4"/>
</page>
<page string="Entry encoding">
<field colspan="4" name="line_ids" nolabel="1">
<tree editable="bottom" string="Statement lines">
<field name="name"/>
<field name="ref"/>
<field name="partner_id" on_change="onchange_partner_id(partner_id, type, parent.currency)"/>
<field name="amount"/>
</tree>
<form string="Statement lines">
<field name="partner_id" on_change="onchange_partner_id(partner_id, type, parent.currency)"/>
<field name="amount"/>
<field name="name"/>
<field name="ref"/>
<separator colspan="4" string="Notes"/>
<field colspan="4" name="note" nolabel="1"/>
</form>
</field>
</page>
</notebook>
<group col="7" colspan="4">
<field name="state" colspan="4"/>
<field name="total_entry_encoding"/>
</group>
<group colspan="4">
<button name="button_dummy" states="draft" string="Compute"/>
<button name="button_confirm" states="open" string="Close CashBox" type="object"/>
<button name="button_open" states="draft" string="Open CashBox" type="object"/>
<button name="button_cancel" states="confirm" string="Cancel" type="object" groups="base.group_extended"/>
</group>
</form>
</field>
</record>
<record id="action_bank_statement_tree_all" model="ir.actions.act_window">
<field name="name">My CashBoxes</field>
<field name="res_model">account.bank.statement</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="view_bank_statement_tree"/>
<field name="domain">[('user_id','=',uid)]</field>
</record>
<record model="ir.actions.act_window.view" id="act_statement1_all">
<field name="sequence" eval="1"/>
<field name="view_mode">tree</field>
<field name="view_id" ref="view_bank_statement_tree"/>
<field name="act_window_id" ref="action_bank_statement_tree_all"/>
</record>
<record model="ir.actions.act_window.view" id="act_statement2_all">
<field name="sequence" eval="1"/>
<field name="view_mode">form</field>
<field name="view_id" ref="view_bank_statement_form1"/>
<field name="act_window_id" ref="action_bank_statement_tree_all"/>
</record>
<!-- <menuitem action="action_bank_statement_tree_all" id="menu_statement_tree_all" parent="point_of_sale.menu_point_root" sequence="2"/-->
<!-- <menuitem action="action_bank_statement_tree_all" id="menu_statement_tree_all" parent="point_of_sale.menu_point_root" sequence="2"/>
-->
<menuitem name="Cash Register" parent="point_of_sale.menu_point_root" id="menu_statement_tree_all" sequence="4"/>
<record id="action_bank_statement_tree1" model="ir.actions.act_window">
<field name="name">My Cashboxes to Close</field>
<field name="res_model">account.bank.statement</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="view_bank_statement_tree"/>
<field name="domain">[('state','=','open'), ('user_id','=',uid)]</field>
</record>
<record model="ir.actions.act_window.view" id="act_statement1">
<field name="sequence" eval="1"/>
<field name="view_mode">tree</field>
<field name="view_id" ref="view_bank_statement_tree"/>
<field name="act_window_id" ref="action_bank_statement_tree1"/>
</record>
<record model="ir.actions.act_window.view" id="act_statement2">
<field name="sequence" eval="1"/>
<field name="view_mode">form</field>
<field name="view_id" ref="view_bank_statement_form1"/>
<field name="act_window_id" ref="action_bank_statement_tree1"/>
</record>
<!-- <menuitem action="action_bank_statement_tree1" id="menu_statement_tree1" parent="menu_statement_tree_all" sequence="2"/>-->
<record id="view_bank_statement_form3" model="ir.ui.view">
<field name="name">account.bank.statement.form</field>
<field name="model">account.bank.statement</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Statement">
<field name="name" select="1"/>
<field name="user_id" select="1"/>
<field name="company_id" select="1" groups="base.group_multi_company"/>
<field name="journal_id" on_change="onchange_journal_id(journal_id)" domain="[('type','=','cash')]" select="1" readonly="1"/>
<newline/>
<field name="date" select="1" attrs="{'readonly':[('state','!=','draft')]}"/>
<field name="closing_date" select="1" attrs="{'readonly':[('state','=','confirm')]}"/>
<field name="balance_start"/>
<field name="balance_end_real"/>
<notebook colspan="4">
<page string="Entry encoding">
<field colspan="4" name="line_ids" nolabel="1">
<tree editable="bottom" string="Statement lines">
<field name="name"/>
<field name="ref"/>
<field name="partner_id" on_change="onchange_partner_id(partner_id, type, parent.currency)"/>
<field name="amount" />
</tree>
<form string="Statement lines">
<field name="partner_id" on_change="onchange_partner_id(partner_id, type, parent.currency)"/>
<field name="amount"/>
<field name="name"/>
<field name="ref"/>
<separator colspan="4" string="Notes"/>
<field colspan="4" name="note" nolabel="1"/>
</form>
</field>
</page>
<page string="Starting Details">
<field name="balance_end" colspan="4" nolabel="1"/>
<newline/>
<field name="starting_details_ids" nolabel = "1" colspan="4">
<tree string = "Starting Details" editable="bottom">
<field name="pieces"/>
<field name="number" on_change="on_change_sub(pieces,number)"/>
<field name="subtotal" sum="Total"/>
</tree>
<form string = "Starting Details">
<field name="pieces"/>
<field name="number" on_change="on_change_sub(pieces,number)"/>
<field name="subtotal"/>
</form>
</field>
</page>
<page string="Ending Details">
<field name="ending_details_ids" nolabel = "1" colspan="4">
<tree string = "Ending Details" editable="bottom">
<field name="pieces"/>
<field name="number" on_change="on_change_sub(pieces,number)"/>
<field name="subtotal" sum="Total"/>
</tree>
<form string = "Ending Details">
<field name="pieces"/>
<field name="number" on_change="on_change_sub(pieces,number)"/>
<field name="subtotal"/>
</form>
</field>
</page>
</notebook>
<group col="7" colspan="4">
<field name="state" colspan="4"/>
<field name="total_entry_encoding"/>
</group>
<group colspan="4">
<button name="button_dummy" states="draft" string="Compute"/>
<button name="button_open" states="draft" string="Open CashBox" type="object" />
<button name="button_confirm" states="open" string="Confirm" type="object" />
<button name="button_cancel" states="confirm" string="Cancel" type="object" groups="base.group_extended"/>
</group>
</form>
</xpath>
</field>
</record>
<record id="view_bank_statement_tree2" model="ir.ui.view">
<field name="name">account.bank.statement.tree</field>
<field name="model">account.bank.statement</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree colors="red:balance_end_real!=balance_end;blue:state=='draft' and (balance_end_real==balance_end)" string="Statement">
<field name="date"/>
<field name="name"/>
<field name="journal_id"/>
<field name="period_id"/>
<field name="balance_start"/>
<field name="balance_end_real"/>
<field name="balance_end"/>
<field name="state"/>
</tree>
</field>
</record>
<record id="action_bank_statement_treenew" model="ir.actions.act_window">
<field name="name">Open a Cash Register</field>
<field name="res_model">account.bank.statement</field>
<field name="view_type">form</field>
<field name="view_id" ref="view_bank_statement_form2"/>
<field name="domain">[('state','=','draft'),('user_id','=',uid)]</field>
<menuitem name="Cash Register" parent="point_of_sale.menu_point_root" id="menu_cash_register" sequence="4"/>
</record>
<record model="ir.actions.act_window.view" id="act_statement12">
<field name="sequence" eval="2"/>
<field name="view_mode">tree</field>
<field name="view_id" ref="view_bank_statement_tree2"/>
<field name="act_window_id" ref="action_bank_statement_treenew"/>
</record>
<record model="ir.actions.act_window.view" id="act_statement22">
<field name="sequence" eval="1"/>
<field name="view_mode">form</field>
<field name="view_id" ref="view_bank_statement_form2"/>
<field name="act_window_id" ref="action_bank_statement_treenew"/>
</record>
<!-- <menuitem action="action_bank_statement_treenew" id="menu_statement_tree2" parent="menu_statement_tree_all" sequence="1"/>-->
<menuitem action="action_bank_statement_treenew" id="menu_statement_tree2" parent="menu_statement_tree_all" sequence="1"/>
<record id="view_account_bank_statment_filter" model="ir.ui.view">
<field name="name">account.bank.statment.select</field>
<field name="model">account.bank.statement</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Search Cashbox">
<group col='9' colspan='4'>
<filter icon="terp-camera_test" string="Open"
domain="[('state','=','open')]"
help="All open cashboxes"/>
<filter icon="terp-dialog-close" string="To Close"
domain="[('state','=','draft')]"
help="All cashboxes to close"/>
<filter icon="terp-go-today" name="Today" string="Today"
domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d 23:59:59'))]"
help="All cashboxes to opened today"/>
<separator orientation="vertical"/>
<field name="name"/>
</group>
<newline/>
<group expand="0" string="Group By..." colspan="4" col="20">
<filter string="Journal" icon="terp-folder-blue" domain="[]" context="{'group_by':'journal_id'}"/>
<filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
</group>
</search>
</field>
</record>
<record model="ir.actions.act_window" id="action_pos_account_bank_statment">
<field name="name">All Cash Registers</field>
<menuitem
name="All Cash Registers"
parent="menu_cash_register"
action="account.action_view_bank_statement_tree"
id="menu_all_menu_cash_register"
sequence="4"
/>
<record id="action_new_bank_statement_tree" model="ir.actions.act_window">
<field name="name">Cash Register</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">account.bank.statement</field>
<field name="view_type">form</field>
<field name="view_id" eval="False"/>
<field name="context">{'search_default_Today':1}</field>
<field name="search_view_id" ref="view_account_bank_statment_filter"/>
<field name="view_mode">form,tree</field>
<field name="view_id" ref="account.view_bank_statement_form2"/>
<field name="search_view_id" ref="account.view_account_bank_statement_filter"/>
<field name="domain">[('journal_id.type', '=', 'cash')]</field>
</record>
<record model="ir.actions.act_window.view" id="act_statement_a1">
<field name="sequence" eval="1"/>
<field name="view_mode">tree</field>
<field name="view_id" ref="view_bank_statement_tree"/>
<field name="act_window_id" ref="action_pos_account_bank_statment"/>
<record model="ir.actions.act_window.view" id="act_cash_statement1_all">
<field name="sequence" eval="5"/>
<field name="view_mode">tree</field>
<field name="view_id" ref="account.view_bank_statement_tree"/>
<field name="act_window_id" ref="action_new_bank_statement_tree"/>
</record>
<record model="ir.actions.act_window.view" id="act_statement_a2">
<field name="sequence" eval="1"/>
<field name="view_mode">form</field>
<field name="view_id" ref="view_bank_statement_form3"/>
<field name="act_window_id" ref="action_pos_account_bank_statment"/>
<record model="ir.actions.act_window.view" id="act_cash_statement2_all">
<field name="sequence" eval="0"/>
<field name="view_mode">form</field>
<field name="view_id" ref="account.view_bank_statement_form2"/>
<field name="act_window_id" ref="action_new_bank_statement_tree"/>
</record>
<menuitem name="All Cash Registers" parent="menu_statement_tree_all"
action="action_pos_account_bank_statment" id="menu_pos_bank_statment_tree" sequence="4"/>
<record model="ir.actions.act_window" id="action_my_all_pos_account_bank_statment">
<field name="name">All My Cashboxes</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">account.bank.statement</field>
<field name="view_type">form</field>
<field name="domain">[('user_id','=',uid)]</field>
</record>
<record model="ir.actions.act_window.view" id="act_my_all_statement_a1">
<field name="sequence" eval="1"/>
<field name="view_mode">tree</field>
<field name="view_id" ref="view_bank_statement_tree"/>
<field name="act_window_id" ref="action_my_all_pos_account_bank_statment"/>
</record>
<record model="ir.actions.act_window.view" id="act_my_all_statement_a2">
<field name="sequence" eval="1"/>
<field name="view_mode">form</field>
<field name="view_id" ref="view_bank_statement_form1"/>
<field name="act_window_id" ref="action_my_all_pos_account_bank_statment"/>
</record>
<!-- <menuitem name="All My Cashboxes" parent="menu_statement_tree_all"-->
<!-- action="action_my_all_pos_account_bank_statment" id="menu_my_pos_bank_statment_tree" sequence="3"/>-->
<record model="ir.actions.act_window" id="action_cashboxes_to_close">
<field name="name">Cashboxes to Close</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">account.bank.statement</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('state','=','draft')]</field>
</record>
<record model="ir.actions.act_window.view" id="act_statement_a5">
<field name="sequence" eval="1"/>
<field name="view_mode">tree</field>
<field name="view_id" ref="view_bank_statement_tree"/>
<field name="act_window_id" ref="action_cashboxes_to_close"/>
</record>
<record model="ir.actions.act_window.view" id="act_statement_a6">
<field name="sequence" eval="1"/>
<field name="view_mode">form</field>
<field name="view_id" ref="view_bank_statement_form1"/>
<field name="act_window_id" ref="action_cashboxes_to_close"/>
</record>
<!-- <menuitem name="Cashboxes to Close" parent="menu_statement_tree_all"-->
<!-- action="action_cashboxes_to_close" id="menu_cashboxes_to_close_tree" groups="base.group_extended"/>-->
<menuitem
name="Opening Operations" parent="point_of_sale.menu_point_root"
string="Opening Operations"
id="menu_open_operations" sequence="1" />
<menuitem
name="Open my Cash Registers" parent="menu_open_operations"
string="Open my Cash Register"
action="action_pos_open_statement"
id="menu_open_statement" sequence="1" />
<menuitem icon="STOCK_PRINT"
action="action_report_all_closed_cashbox_of_the_day"
id="menu_all_closed_cashbox_of_the_day"
parent="menu_statement_tree_all"/>
<menuitem
name="Closing Operations" parent="point_of_sale.menu_point_root"
string="Closing Operations"
id="menu_closing_operations" sequence="3" />
<menuitem
name="Close my Cash Registers" parent="menu_closing_operations"
string="Close my Cash Registers"
action="action_pos_close_statement"
id="menu_close_statement" sequence="1" />
<menuitem icon="STOCK_PRINT"
action="action_report_all_closed_cashbox_of_the_day"
id="menu_all_closed_cashbox_of_the_day"
parent="menu_point_report_register"/>
<menuitem
name="Open a Cash Registers"
parent="menu_cash_register"
action="action_new_bank_statement_tree"
id="menu_new_cash_register"
sequence="3"
/>
</data>
</openerp>