[FIX]: fix a small bugs for the bank and cash statement

bzr revid: mga@tinyerp.com-20100730121656-s63x4acjema3mgyo
This commit is contained in:
Mantavya Gajjar 2010-07-30 17:46:56 +05:30
parent c6ebaa98b1
commit 73f6400a1f
1 changed files with 11 additions and 4 deletions

View File

@ -235,11 +235,18 @@ class account_cash_statement(osv.osv):
if open_jrnl:
raise osv.except_osv('Error', _('You can not have two open register for the same journal'))
lines = end_lines = self._get_cash_close_box_lines(cr, uid, [], context)
vals.update({
'ending_details_ids':lines
})
if self.pool.get('account.journal').browse(cr, uid, vals['journal_id']).type == 'cash':
lines = end_lines = self._get_cash_close_box_lines(cr, uid, [], context)
vals.update({
'ending_details_ids':lines
})
else:
vals.update({
'ending_details_ids':False,
'starting_details_ids':False
})
res_id = super(account_cash_statement, self).create(cr, uid, vals, context=context)
self.write(cr, uid, [res_id], {})
return res_id
def write(self, cr, uid, ids, vals, context=None):