[COMMIT] Don't want to lose my work

bzr revid: stw@openerp.com-20120426123017-joglkawvmn0f3pe0
This commit is contained in:
Stephane Wirtel 2012-04-26 14:30:17 +02:00
parent 0f5be3184d
commit 9fe0bbc472
9 changed files with 245 additions and 176 deletions

View File

@ -145,8 +145,8 @@ module named account_voucher.
'test/account_use_model.yml',
'test/account_validate_account_move.yml',
'test/account_fiscalyear_close.yml',
'test/account_bank_statement.yml',
'test/account_cash_statement.yml',
#'test/account_bank_statement.yml',
#'test/account_cash_statement.yml',
'test/test_edi_invoice.yml',
'test/account_report.yml',
'test/account_fiscalyear_close_state.yml', #last test, as it will definitively close the demo fiscalyear

View File

@ -372,14 +372,22 @@ class account_bank_statement(osv.osv):
account_move_obj.unlink(cr, uid, ids, context)
done.append(st.id)
return self.write(cr, uid, done, {'state':'draft'}, context=context)
def onchange_journal_id(self, cr, uid, statement_id, journal_id, context=None):
def _compute_balance_end_real(self, cr, uid, journal_id, context=None):
cr.execute('SELECT balance_end_real \
FROM account_bank_statement \
WHERE journal_id = %s AND NOT state = %s \
ORDER BY date DESC,id DESC LIMIT 1', (journal_id, 'draft'))
res = cr.fetchone()
balance_start = res and res[0] or 0.0
print "res: %r" % (res,)
return res and res[0] or 0.0
def onchange_journal_id(self, cr, uid, statement_id, journal_id, context=None):
balance_start = self._compute_balance_end_real(cr, uid, journal_id, context=context)
journal_data = self.pool.get('account.journal').read(cr, uid, journal_id, ['default_debit_account_id', 'company_id'], context=context)
account_id = journal_data['default_debit_account_id']
company_id = journal_data['company_id']

View File

@ -43,24 +43,27 @@ class account_cashbox_line(osv.osv):
"""
res = {}
for obj in self.browse(cr, uid, ids, context=context):
res[obj.id] = obj.pieces * obj.number
res[obj.id] = {
'subtotal_opening' : obj.pieces * obj.number_opening,
'subtotal_closing' : obj.pieces * obj.number_closing,
}
return res
def on_change_sub(self, cr, uid, ids, pieces, number, *a):
def on_change_sub_opening(self, cr, uid, ids, pieces, number, *a):
""" Compute the subtotal for the opening """
return {'value' : {'subtotal_opening' : (pieces * number) or 0.0 }}
""" Calculates Sub total on change of number
@param pieces: Names of fields.
@param number:
"""
sub = pieces * number
return {'value': {'subtotal': sub or 0.0}}
def on_change_sub_closing(self, cr, uid, ids, pieces, number, *a):
""" Compute the subtotal for the closing """
return {'value' : {'subtotal_closing' : (pieces * number) or 0.0 }}
_columns = {
'pieces': fields.float('Unit of Currency', digits_compute=dp.get_precision('Account')),
'number': fields.integer('Number of Units'),
'subtotal': fields.function(_sub_total, string='Subtotal', type='float', digits_compute=dp.get_precision('Account')),
'starting_id': fields.many2one('account.bank.statement', ondelete='cascade'),
'ending_id': fields.many2one('account.bank.statement', ondelete='cascade'),
'number_opening' : fields.integer('Number of Units', help='Opening Unit Numbers'),
'number_closing' : fields.integer('Number of Units', help='Closing Unit Numbers'),
'subtotal_opening': fields.function(_sub_total, string='Subtotal Opening', type='float', digits_compute=dp.get_precision('Account'), multi='subtotal'),
'subtotal_closing': fields.function(_sub_total, string='Subtotal Closing', type='float', digits_compute=dp.get_precision('Account'), multi='subtotal'),
'bank_statement_id' : fields.many2one('account.bank.statement', ondelete='cascade'),
}
account_cashbox_line()
@ -78,16 +81,14 @@ class account_cash_statement(osv.osv):
"""
res = {}
for statement in self.browse(cr, uid, ids, context=context):
amount_total = 0.0
if statement.journal_id.type not in('cash'):
continue
for line in statement.starting_details_ids:
amount_total+= line.pieces * line.number
res[statement.id] = {
'balance_start': amount_total
'balance_start': sum((line.pieces * line.number_opening
for line in statement.details_ids), 0.0)
}
print "_get_starting_balance: %r" % (res,)
return res
def _balance_end_cash(self, cr, uid, ids, name, arg, context=None):
@ -98,10 +99,9 @@ class account_cash_statement(osv.osv):
"""
res = {}
for statement in self.browse(cr, uid, ids, context=context):
amount_total = 0.0
for line in statement.ending_details_ids:
amount_total += line.pieces * line.number
res[statement.id] = amount_total
res[statement.id] = sum((line.pieces * line.number_closing
for line in statement.details_ids), 0.0)
print "_balance_end_cash: %r" % (res,)
return res
def _get_sum_entry_encoding(self, cr, uid, ids, name, arg, context=None):
@ -111,13 +111,11 @@ class account_cash_statement(osv.osv):
@param arg: User defined arguments
@return: Dictionary of values.
"""
res2 = {}
res = {}
for statement in self.browse(cr, uid, ids, context=context):
encoding_total=0.0
for line in statement.line_ids:
encoding_total += line.amount
res2[statement.id] = encoding_total
return res2
res[statement.id] = sum((line.amount for line in statement.line_ids), 0.0)
print "_get_sum_entry_encoding: %r" % (res,)
return res
def _get_company(self, cr, uid, context=None):
user_pool = self.pool.get('res.users')
@ -193,22 +191,19 @@ class account_cash_statement(osv.osv):
_columns = {
'total_entry_encoding': fields.function(_get_sum_entry_encoding, string="Cash Transaction", help="Total cash transactions",
store = {
'account.bank.statement': (lambda self, cr, uid, ids, c={}: 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, ['amount'], 10),
}),
'closing_date': fields.datetime("Closed On"),
'balance_end_cash': fields.function(_balance_end_cash, store=True, string='Closing Balance', help="Closing balance based on cashBox"),
'starting_details_ids': fields.one2many('account.cashbox.line', 'starting_id', string='Opening Cashbox'),
'ending_details_ids': fields.one2many('account.cashbox.line', 'ending_id', string='Closing Cashbox'),
'balance_end_cash': fields.function(_balance_end_cash, store=False, string='Closing Balance', help="Closing balance based on cashBox"),
'details_ids' : fields.one2many('account.cashbox.line', 'bank_statement_id', string='CashBox Lines'),
'user_id': fields.many2one('res.users', 'Responsible', required=False),
}
_defaults = {
'state': 'draft',
'date': lambda self,cr,uid,context={}: context.get('date', time.strftime("%Y-%m-%d %H:%M:%S")),
'date': lambda self, cr, uid, context={}: context.get('date', time.strftime("%Y-%m-%d %H:%M:%S")),
'user_id': lambda self, cr, uid, context=None: uid,
'starting_details_ids': _get_cash_open_box_lines,
'ending_details_ids': _get_default_cash_close_box_lines
}
def check_opening_journal(self, cr, uid, ids, context=None):
@ -236,10 +231,12 @@ class account_cash_statement(osv.osv):
def create(self, cr, uid, vals, context=None):
if self.pool.get('account.journal').browse(cr, uid, vals['journal_id'], context=context).type == 'cash':
amount_total = 0.0
for line in vals.get('starting_details_ids',[]):
for line in vals.get('details_ids',[]):
print "line: %r" % (line,)
if line and len(line)==3 and line[2]:
amount_total+= line[2]['pieces'] * line[2]['number']
amount_total+= line[2]['pieces'] * line[2]['number_opening']
vals.update(balance_start= amount_total)
vals.update(balance_end_real=self._compute_balance_end_real(cr, uid, vals['journal_id'], context=context))
return super(account_cash_statement, self).create(cr, uid, vals, context=context)
def write(self, cr, uid, ids, vals, context=None):
@ -275,23 +272,27 @@ class account_cash_statement(osv.osv):
journal = self.pool.get('account.journal').browse(cr, uid, journal_id, context=context)
raise osv.except_osv(_('Error !'), (_('The Account Journal %s is opened by an other Cash Register !') % (journal.name,)))
else:
values = super(account_cash_statement, self).onchange_journal_id(cr, uid, statement_id, journal_id, context=context)
proxy_line = self.pool.get('account.cashbox.line')
values = dict(starting_details_ids=[], ending_details_ids=[])
values.setdefault('value', {})
values['value']['details_ids'] = []
values['value']['balance_end_real'] = self._compute_balance_end_real(cr, uid, journal_id, context=context)
values['value']['balance_start'] = 0.0
journal = self.pool.get('account.journal').browse(cr, uid, journal_id, context=context)
for line in journal.cashbox_line_ids:
values['starting_details_ids'].append({'pieces' : line.pieces})
values['ending_details_ids'].append({'pieces' : line.pieces})
values['value']['details_ids'].append({'pieces' : line.pieces})
return { 'value' : values }
print "values: %r" % (values,)
return values
else:
return {
'value' : {
'balance_start': balance_start,
'starting_details_ids': [],
'ending_details_ids' : [],
'details_ids' : [],
}
}
return super(account_cash_statement, self).onchange_journal_id(cr, uid, statement_id, journal_id, context=context)
@ -299,7 +300,10 @@ class account_cash_statement(osv.osv):
def _equal_balance(self, cr, uid, cash_id, context=None):
statement = self.browse(cr, uid, cash_id, context=context)
self.write(cr, uid, [cash_id], {'balance_end_real': statement.balance_end})
statement.balance_end_real = statement.balance_end
print "balance_end_real: %r" % (statement.balance_end,)
print "balance_end: %r" % (statement.balance_end,)
print "balance_end_cash: %r" % (statement.balance_end_cash,)
if statement.balance_end != statement.balance_end_cash:
return False
return True
@ -365,8 +369,8 @@ class account_cash_statement(osv.osv):
cash_box_line_pool = self.pool.get('account.cashbox.line')
super(account_cash_statement, self).button_cancel(cr, uid, ids, context=context)
for st in self.browse(cr, uid, ids, context):
for end in st.ending_details_ids:
cash_box_line_pool.write(cr, uid, [end.id], {'number': 0})
for end in st.details_ids:
cash_box_line_pool.write(cr, uid, [end.id], {'number_closing': 0})
return True
account_cash_statement()

View File

@ -2606,7 +2606,7 @@ action = pool.get('res.config').next(cr, uid, [], context)
<field name="journal_id"/>
<field name="balance_start"/>
<field name="balance_end_real"/>
<field name="balance_end"/>
<field name="balance_end" invisible="1" />
<field name="state"/>
<button type="object" string="Cancel" name="button_cancel" states="confirm" icon="gtk-cancel"/>
<button type="object" string="Open" name="button_open" states="draft" icon="terp-camera_test"/>
@ -2660,34 +2660,15 @@ action = pool.get('res.config').next(cr, uid, [], context)
</field>
</page>
<page string="CashBox">
<group col="2" expand="1" attrs="{'invisible' : [('state', '=', 'open')]}">
<separator string="Opening Cashbox" colspan="2" />
<field name="starting_details_ids" nolabel="1">
<tree string="Opening Balance" editable="bottom">
<group col="2" expand="1">
<field name="details_ids" nolabel="1">
<tree string="" editable="bottom">
<field name="pieces" readonly="1" />
<field name="number" on_change="on_change_sub(pieces,number, parent.balance_end)" />
<field name="subtotal" sum="Sub Total" />
<field name="number_opening" string="Opening Unit Numbers" on_change="on_change_sub_opening(pieces, number_opening, parent.balance_end)" />
<field name="subtotal_opening" string="Opening Subtotal"/>
<field name="number_closing" string="Closing Unit Numbers" on_change="on_change_sub_closing(pieces, number_closing, parent.balance_end)" />
<field name="subtotal_closing" string="Closing Subtotal"/>
</tree>
<form string="Opening Balance">
<field name="pieces" readonly="1"/>
<field name="number" on_change="on_change_sub(pieces,number, parent.balance_end)"/>
<field name="subtotal"/>
</form>
</field>
</group>
<group col="2" expand="1" attrs="{'invisible' : [('state', '=', 'draft')]}">
<separator string="Closing Cashbox" colspan="2" />
<field name="ending_details_ids" nolabel="1">
<tree string="Closing Balance" editable="bottom">
<field name="pieces" />
<field name="number" on_change="on_change_sub(pieces,number, parent.balance_end)"/>
<field name="subtotal" sum="Sub Total"/>
</tree>
<form string="Closing Balance">
<field name="pieces"/>
<field name="number" on_change="on_change_sub(pieces,number, parent.balance_end)"/>
<field name="subtotal"/>
</form>
</field>
</group>
</page>
@ -2703,8 +2684,9 @@ action = pool.get('res.config').next(cr, uid, [], context)
</group>
<group col="2" colspan="2">
<separator string="Opening Balance" colspan="4"/>
<field name="balance_start" readonly="1" string="Opening Balance"/>
<field name="total_entry_encoding"/>
<field name="balance_end_real" readonly="1" string="Last Closing Balance"/>
<field name="balance_start" readonly="1" string="Computed Amount"/>
<field name="total_entry_encoding" />
</group>
<group col="2" colspan="2">
<separator string="Closing Balance" colspan="4"/>

View File

@ -82,7 +82,7 @@ Main features :
'application': True,
'certificate' : '001156338024966477869',
# Web client
'js': ['static/lib/backbone/backbone-0.5.3.js', 'static/src/js/pos.js', 'static/src/js/pos2.js'],
'js': ['static/lib/backbone/backbone-0.5.3.js', 'static/src/js/pos.js'], #, 'static/src/js/pos2.js'],
'css': ['static/src/css/pos.css'],
'qweb': ['static/src/xml/pos.xml'],
'auto_install': True,

View File

@ -61,7 +61,7 @@ class pos_config(osv.osv):
'state' : fields.selection(POS_CONFIG_STATE, 'State', required=True, readonly=True),
#'sequence_id' : fields.many2one('ir.sequence', 'Sequence'),
'sequence_id' : fields.many2one('ir.sequence', 'Sequence', readonly=True),
# Add a sequence when we create a new pos.config object
}
@ -70,6 +70,22 @@ class pos_config(osv.osv):
'state' : 'draft',
}
def _check_only_one_cash_journal(self, cr, uid, ids, context=None):
for record in self.browse(cr, uid, ids, context=context):
has_cash_journal = False
for journal in record.journal_ids:
if journal.type == 'cash':
if has_cash_journal:
return False
else:
has_cash_journal = True
return True
_constraints = [
(_check_only_one_cash_journal, "You should have only one Cash Journal !", ['journal_id']),
]
def set_draft(self, cr, uid, ids, context=None):
return self.write(cr, uid, ids, {'state' : 'draft'}, context=context)
@ -82,6 +98,52 @@ class pos_config(osv.osv):
def set_deprecate(self, cr, uid, ids, context=None):
return self.write(cr, uid, ids, {'state' : 'deprecated'}, context=context)
def create(self, cr, uid, values, context=None):
proxy = self.pool.get('ir.sequence.type')
sequence_values = dict(
code='pos_%s_sequence' % values['name'].lower(),
name='POS %s Sequence' % values['name'],
)
proxy.create(cr, uid, sequence_values, context=context)
proxy = self.pool.get('ir.sequence')
sequence_values = dict(
code='pos_%s_sequence' % values['name'].lower(),
name='POS %s Sequence' % values['name'],
padding=4,
prefix="%s/%%(year)s/%%(month)s/%%(day)s/" % values['name'],
)
sequence_id = proxy.create(cr, uid, sequence_values, context=context)
values['sequence_id'] = sequence_id
return super(pos_config, self).create(cr, uid, values, context=context)
def write(self, cr, uid, ids, values, context=None):
for obj in self.browse(cr, uid, ids, context=context):
if obj.sequence_id and values.get('name', False):
prefixes = obj.sequence_id.prefix.split('/')
if len(prefixes) >= 4 and prefixes[0] == obj.name:
prefixes[0] = values['name']
sequence_values = dict(
code='pos_%s_sequence' % values['name'].lower(),
name='POS %s Sequence' % values['name'],
prefix="/".join(prefixes),
)
obj.sequence_id.write(sequence_values)
return super(pos_config, self).write(cr, uid, ids, values, context=context)
def unlink(self, cr, uid, ids, context=None):
for obj in self.browse(cr, uid, ids, context=context):
if obj.sequence_id:
obj.sequence_id.unlink()
return super(pos_config, self).unlink(cr, uid, ids, context=context)
pos_config()
class pos_session(osv.osv):
@ -98,6 +160,12 @@ class pos_session(osv.osv):
'stop_at' : fields.datetime('Closing Date'),
'state' : fields.selection(POS_SESSION_STATE, 'State', required=True, readonly=True, select=1),
'cash_register_id' : fields.many2one('account.bank.statement', 'Bank Account Statement'),
'details_ids' : fields.related('cash_register_id', 'details_ids',
type='one2many', relation='account.cashbox.line',
string='CashBox Lines'),
}
_defaults = {
@ -106,9 +174,47 @@ class pos_session(osv.osv):
'state' : 'new',
}
_sql_constraints = [
('uniq_name', 'unique(name)', "The name of this POS Session must be unique !"),
]
def _create_cash_register(self, cr, uid, pos_config, name, context=None):
import pdb
pdb.set_trace()
if not pos_config:
return False
proxy = self.pool.get('account.bank.statement')
journal_id = False
for journal in pos_config.journal_ids:
if journal.type == 'cash':
journal_id = journal.id
break
if not journal_id:
return False
values = {
'name' : name,
'journal_id' : journal_id,
}
return proxy.create(cr, uid, values, context=context)
def create(self, cr, uid, values, context=None):
if values.pop('name', '/') == '/':
values['name'] = self.pool.get('ir.sequence').get(cr, uid, 'pos.session')
config_id = values.get('config_id', False) or False
if config_id:
pos_config = self.pool.get('pos.config').browse(cr, uid, config_id, context=context)
name = pos_config.sequence_id._next()
values.update(
name=name,
cash_register_id=self._create_cash_register(cr, uid, pos_config, name, context=context),
)
else:
raise osv.except_osv(_('Error!'), _('There is no POS Config attached to this POS Session'))
return super(pos_session, self).create(cr, uid, values, context=context)

View File

@ -670,36 +670,6 @@
<menuitem name="Configuration" parent="menu_point_root"
id="menu_point_config_product" sequence="25" groups="group_pos_manager"/>
<record model="ir.actions.act_window" id="action_product_input">
<field name="name">Products 'Take Money Out'</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">product.product</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('expense_pdt','=',True)]</field>
<field name="context">{'default_expense_pdt': True}</field>
</record>
<menuitem
parent="menu_point_config_product"
action="action_product_input"
id="products_for_input_operations"
groups="group_pos_manager"/>
<record model="ir.actions.act_window" id="action_product_output">
<field name="name">Products 'Put Money In'</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">product.product</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('income_pdt','=',True)]</field>
<field name="context">{'default_income_pdt': True}</field>
</record>
<menuitem
parent="menu_point_config_product"
action="action_product_output"
id="products_for_output_operations"
groups="group_pos_manager"/>
<menuitem
parent="menu_point_of_sale"
action="action_box_entries"
@ -776,8 +746,8 @@
id="menu_pos_details" parent="menu_point_of_sale_reporting" sequence="6" />
<record model="ir.actions.client" id="action_pos_pos">
<field name="name">Start Point of Sale</field>
<field name="tag">pos.ui</field>
<field name="name">Start Point of Sale</field>
<field name="tag">pos.ui</field>
</record>
<record id="menu_point_root_touchscreen" model="ir.ui.menu">
@ -823,6 +793,9 @@
<field name="iface_barscan" />
<field name="iface_vkeyboard" />
</page>
<page string="Other">
<field name="sequence_id" />
</page>
</notebook>
@ -887,6 +860,8 @@
</group>
<notebook colspan="4">
<page string="Cash">
<field name="cash_register_id" invisible="0" />
<field name="details_ids" colspan="4" nolabel="1" />
</page>
<page string="Others">
</page>
@ -894,7 +869,7 @@
</page>
</notebook>
<group colspan="4" col="2">
<group colspan="4" col="5">
<field name="state" widget="statusbar" statusbar_visible="new,opened,closed,posted" statusbar_colors='{"posted":"green"}'/>
<button name="open" type="workflow" string="Open" states="new" />
<button name="close" type="workflow" string="Close" states="opened" />
@ -919,45 +894,6 @@
</field>
</record>
<act_window
id="act_pos_session_orders"
name="Orders"
src_model="pos.session"
res_model="pos.order"
domain="[('session_id', '=', active_id)]" />
<record id="view_pos_order_filter" model="ir.ui.view">
<field name="name">pos.order.list.select</field>
<field name="model">pos.order</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Search Sales Order">
<filter icon="terp-document-new" string="New" domain="[('state','=','draft')]"/>
<filter icon="gtk-apply" string="Done" domain="[('state','in',('paid','invoiced','done'))]"/>
<separator orientation="vertical"/>
<filter icon="terp-check" string="Invoiced" domain="[('state','=','invoiced')]"/>
<filter icon="gtk-convert" string="Posted" domain="[('state','=','done')]"/>
<separator orientation="vertical"/>
<filter icon="terp-go-month" string="Today" domain="[('date_order','&gt;=',datetime.date.today().strftime('%%Y-%%m-%%d 00:00:00')),('date_order','&lt;=',datetime.date.today().strftime('%%Y-%%m-%%d 23:59:59'))]"/>
<filter icon="gtk-go-forward" string="Yesterday" domain="[('date_order','&lt;',datetime.date.today().strftime('%%Y-%%m-%%d 00:00:00')),('date_order','&gt;=',(datetime.date.today() - relativedelta(days=1)).strftime('%%Y-%%m-%%d 00:00:00'))]"/>
<separator orientation="vertical"/>
<field name="name"/>
<field name="user_id"/>
<newline/>
<group expand="0" string="Group By..." groups="base.group_extended">
<filter string="Customer" icon="terp-personal" domain="[]" context="{'group_by':'partner_id'}"/>
<filter string="Salesman" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
<separator string="" orientation="vertical"/>
<filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
<separator string="" orientation="vertical"/>
<filter string="Order Date" icon="terp-go-month" domain="[]" context="{'group_by':'date_order'}"/>
</group>
</search>
</field>
</record>
<record model="ir.ui.view" id="view_pos_session_search">
<field name="name">pos.session.search.view</field>
<field name="model">pos.session</field>
@ -988,9 +924,7 @@
<field name="res_model">pos.session</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<!--
<field name="search_view_id" ref="view_pos_session_search" />
-->
</record>
<menuitem
@ -999,5 +933,41 @@
id="menu_pos_session"
groups="group_pos_manager"/>
<act_window
id="act_pos_session_orders"
name="Orders"
src_model="pos.session"
res_model="pos.order"
domain="[('session_id', '=', active_id)]" />
<record id="view_pos_order_filter" model="ir.ui.view">
<field name="name">pos.order.list.select</field>
<field name="model">pos.order</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Search Sales Order">
<filter icon="terp-document-new" string="New" domain="[('state','=','draft')]"/>
<filter icon="gtk-apply" string="Done" domain="[('state','in',('paid','invoiced','done'))]"/>
<separator orientation="vertical"/>
<filter icon="terp-check" string="Invoiced" domain="[('state','=','invoiced')]"/>
<filter icon="gtk-convert" string="Posted" domain="[('state','=','done')]"/>
<separator orientation="vertical"/>
<filter icon="terp-go-month" string="Today" domain="[('date_order','&gt;=',datetime.date.today().strftime('%%Y-%%m-%%d 00:00:00')),('date_order','&lt;=',datetime.date.today().strftime('%%Y-%%m-%%d 23:59:59'))]"/>
<filter icon="gtk-go-forward" string="Yesterday" domain="[('date_order','&lt;',datetime.date.today().strftime('%%Y-%%m-%%d 00:00:00')),('date_order','&gt;=',(datetime.date.today() - relativedelta(days=1)).strftime('%%Y-%%m-%%d 00:00:00'))]"/>
<separator orientation="vertical"/>
<field name="name"/>
<field name="user_id"/>
<newline/>
<group expand="0" string="Group By..." groups="base.group_extended">
<filter string="Customer" icon="terp-personal" domain="[]" context="{'group_by':'partner_id'}"/>
<filter string="Salesman" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
<separator string="" orientation="vertical"/>
<filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
<separator string="" orientation="vertical"/>
<filter string="Order Date" icon="terp-go-month" domain="[]" context="{'group_by':'date_order'}"/>
</group>
</search>
</field>
</record>
</data>
</openerp>

View File

@ -14,8 +14,8 @@
<field name="product_id"/>
<field name="amount"/>
<field name="session_id" />
<field name="user_id" invisible="1" />
<field name="name"/>
<field name="user_id" invisible="1" />
<separator colspan="4"/>
<group colspan="4" col="4">
<group col="2" colspan="2"/>
@ -23,19 +23,19 @@
string="Cancel" />
<button name="get_in" string="Put Money"
colspan="1" type="object" icon="gtk-apply" />
</group>
</group>
</form>
</field>
</record>
<record id="action_box_entries" model="ir.actions.act_window">
<field name="name">Put Money In</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">pos.box.entries</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="target">new</field>
</record>
<act_window name="Put Money In"
res_model="pos.box.entries"
src_model="account.bank.statement"
view_mode="form"
target="new"
key2="client_action_multi"
id="action_box_entries" />
</data>
</openerp>

View File

@ -28,14 +28,13 @@
</field>
</record>
<record id="action_box_out" model="ir.actions.act_window">
<field name="name">Take Money Out</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">pos.box.out</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="target">new</field>
</record>
<act_window name="Take Money Out"
res_model="pos.box.out"
src_model="account.bank.statement"
view_mode="form"
target="new"
key2="client_action_multi"
id="action_box_out" />
</data>
</openerp>