Add empty_account on trial balance for issue616

This commit is contained in:
Cédric Krier committed 2008-12-23 14:56:44 +01:00
1 parent d121745096
commit 3a3342f59d
2 files changed
+16 -1

No files matched your search

+14
View File
@@ -1164,6 +1164,8 @@ class PrintTrialBalanceInit(WizardOSV):
"('start_date', '>=', (start_period, 'start_date'))]")
company = fields.Many2One('company.company', 'Company', required=True)
posted = fields.Boolean('Posted Move', help='Only posted move')
empty_account = fields.Boolean('Empty Account',
help='With account without move')
def default_fiscalyear(self, cursor, user, context=None):
fiscalyear_obj = self.pool.get('account.fiscalyear')
@@ -1188,6 +1190,9 @@ class PrintTrialBalanceInit(WizardOSV):
def default_posted(self, cursor, user, context=None):
return False
def default_empty_account(self, cursor, user, context=None):
return False
def on_change_fiscalyear(self, cursor, user, ids, vals, context=None):
return {
'start_period': False,
@@ -1275,6 +1280,15 @@ class TrialBalance(Report):
accounts = account_obj.browse(cursor, user, account_ids,
context=ctx)
if not datas['form']['empty_account']:
to_remove = []
for account in accounts:
if account.debit == Decimal('0.0') \
and account.credit == Decimal('0.0'):
to_remove.append(account)
for account in to_remove:
accounts.remove(account)
periods = period_obj.browse(cursor, user, end_period_ids,
context=context)
+2 -1
View File
@@ -681,7 +681,8 @@ this repository contains the full copyright notices and license terms. -->
<form string="Print Trial Balance">
<label name="fiscalyear"/>
<field name="fiscalyear"/>
<newline/>
<label name="empty_account"/>
<field name="empty_account"/>
<label name="start_period"/>
<field name="start_period"/>
<label name="end_period"/>