@ -129,8 +129,7 @@ class TestTrialBalanceReport(common.TransactionCase):
unaffected_credit = 0
unaffected_credit = 0
) :
) :
move_name = ' expense accrual '
move_name = ' expense accrual '
journal = self . env [ ' account.journal ' ] . search ( [
( ' code ' , ' = ' , ' MISC ' ) ] )
journal = self . env [ ' account.journal ' ] . search ( [ ] , limit = 1 )
partner = self . env . ref ( ' base.res_partner_12 ' )
partner = self . env . ref ( ' base.res_partner_12 ' )
move_vals = {
move_vals = {
' journal_id ' : journal . id ,
' journal_id ' : journal . id ,
@ -213,10 +212,19 @@ class TestTrialBalanceReport(common.TransactionCase):
return lines
return lines
def test_00_account_group ( self ) :
def test_00_account_group ( self ) :
self . assertEqual ( len ( self . group1 . compute_account_ids . ids ) , 19 )
self . assertEqual ( len ( self . group2 . compute_account_ids . ids ) , 9 )
self . assertGreater Equal ( len ( self . group1 . compute_account_ids ) , 19 )
self . assertGreater Equal ( len ( self . group2 . compute_account_ids ) , 9 )
def test_01_account_balance_computed ( self ) :
def test_01_account_balance_computed ( self ) :
# Make sure there's no account of type "Current Year Earnings" in the
# groups - We change the code
earning_accs = self . env [ ' account.account ' ] . search ( [
( ' user_type_id ' , ' = ' ,
self . env . ref ( ' account.data_unaffected_earnings ' ) . id )
] )
for acc in earning_accs :
if acc . code . startswith ( ' 1 ' ) or acc . code . startswith ( ' 2 ' ) :
acc . code = ' 999 ' + acc . code
# Generate the general ledger line
# Generate the general ledger line
lines = self . _get_report_lines ( )
lines = self . _get_report_lines ( )
self . assertEqual ( len ( lines [ ' receivable ' ] ) , 1 )
self . assertEqual ( len ( lines [ ' receivable ' ] ) , 1 )
@ -248,7 +256,7 @@ class TestTrialBalanceReport(common.TransactionCase):
self . assertEqual ( lines [ ' group1 ' ] . credit , 0 )
self . assertEqual ( lines [ ' group1 ' ] . credit , 0 )
self . assertEqual ( lines [ ' group1 ' ] . final_balance , 1000 )
self . assertEqual ( lines [ ' group1 ' ] . final_balance , 1000 )
# Add reversal e move of the initial move the first day of fiscal year
# Add reversed move of the initial move the first day of fiscal year
# to check the first day of fiscal year is not used
# to check the first day of fiscal year is not used
# to compute the initial balance
# to compute the initial balance
self . _add_move (
self . _add_move (