summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorMantavya Gajjar <mga@tinyerp.com>2010-07-30 17:46:56 +0530
committerMantavya Gajjar <mga@tinyerp.com>2010-07-30 17:46:56 +0530
commit73f6400a1fc736d25995add13b9bb3d889de9382 (patch)
tree60bb57befc92d8e058c8a2aa2b2892c405dfec37 /addons
parentc6ebaa98b12653299c12094a333f94428d5fde73 (diff)
[FIX]: fix a small bugs for the bank and cash statement
bzr revid: mga@tinyerp.com-20100730121656-s63x4acjema3mgyo
Diffstat (limited to 'addons')
-rw-r--r--addons/account/account_cash_statement.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/addons/account/account_cash_statement.py b/addons/account/account_cash_statement.py
index d7162837d63..f618bcfeefd 100644
--- a/addons/account/account_cash_statement.py
+++ b/addons/account/account_cash_statement.py
@@ -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):