diff --git a/addons/account_test/account_test.py b/addons/account_test/account_test.py index 069ba6601e4..dc7442b1247 100644 --- a/addons/account_test/account_test.py +++ b/addons/account_test/account_test.py @@ -56,9 +56,9 @@ class accounting_assert_test(osv.osv): } _defaults = { - 'code_exec': lambda *a: CODE_EXEC_DEFAULT, - 'active': lambda *a: True, - 'sequence': lambda *a: 10, + 'code_exec': CODE_EXEC_DEFAULT, + 'active': True, + 'sequence': 10, } accounting_assert_test() diff --git a/addons/account_test/account_test_data.xml b/addons/account_test/account_test_data.xml index 453d8184b9e..5b82fb82350 100644 --- a/addons/account_test/account_test_data.xml +++ b/addons/account_test/account_test_data.xml @@ -30,7 +30,7 @@ cr.execute("select coalesce(sum(debit),0) as debit_new_fyear,coalesce(sum(credit rec = cr.dictfetchall() cr.execute("select coalesce(sum(debit),0) as debit_last_fyear,coalesce(sum(credit),0) as credit_last_fyear from account_move_line where period_id in (select period_id from account_fiscalyear where state='done' order by id desc limit 1);") rec2= cr.dictfetchall() -if (rec2[0]['credit_last_fyear']-rec[0]['credit_new_fyear']!=0) or (rec2[0]['dedit_last_fyear']-rec[0]['dedit_new_fyear']!=0) : +if (rec2[0]['credit_last_fyear']-rec[0]['credit_new_fyear']!=0) or (rec2[0]['debit_last_fyear']-rec[0]['debit_new_fyear']!=0) : res.append(rec[0]) res.insert(0,_('* New fiscalyear debit and credit are:')) res.append(rec2[0]) @@ -61,7 +61,7 @@ cr.execute(sql) res = cr.dictfetchall() if res: res.insert(0,_('* The test failed for these movement lines:')) - result = res +result = res ]]> @@ -80,7 +80,7 @@ for record in rec_ids : res.append(', '.join(["Reconcile name: %(name)s, id=%(id)s " % r for r in reconcile_ids])) result = res if result: - res.insert(0,_('* The test failed for these reconciled items(id/name):')) + result.insert(0,_('* The test failed for these reconciled items(id/name):')) ]]> @@ -101,18 +101,19 @@ if result: ]]> - 6 Test 5.2 : Reconcilied invoices and Payable/Receivable accounts Check that reconciled account moves, that define Payable and Receivable accounts, are belonging to reconciled invoices diff --git a/addons/account_test/account_test_view.xml b/addons/account_test/account_test_view.xml index bcedebf0eeb..ea8572554ed 100644 --- a/addons/account_test/account_test_view.xml +++ b/addons/account_test/account_test_view.xml @@ -38,6 +38,8 @@ +
 Example: 
 sql = 'select id, name, ref, date from account_move_line where account_id in 
diff --git a/addons/account_test/report/account_test_report.py b/addons/account_test/report/account_test_report.py
index 66d5043412f..5c274773cd4 100644
--- a/addons/account_test/report/account_test_report.py
+++ b/addons/account_test/report/account_test_report.py
@@ -43,6 +43,7 @@ class report_assert_account(report_sxw.rml_parse):
         def group(lst, col):
             return dict((k, [v for v in itr]) for k, itr in groupby(sorted(lst, key=lambda x: x[col]), itemgetter(col)))
 
+        #TODO what is this method used for, name unclear and doesn't seem to be used
         def sort_by_intified_num(a, b):
             if a is None:
                 return -1
@@ -56,7 +57,6 @@ class report_assert_account(report_sxw.rml_parse):
             reconciled_inv_ids = self.pool.get('account.invoice').search(self.cr, self.uid, [('reconciled','=',True)])
             return reconciled_inv_ids
 
-
         def get_parent(acc_id):
             acc_an_id = self.pool.get('account.analytic.account').browse(self.cr, self.uid, acc_id).parent_id
             while acc_an_id.parent_id:
@@ -89,6 +89,7 @@ class report_assert_account(report_sxw.rml_parse):
 
         if not result:
             result = [_('The test was passed successfully')]
+        #TODO: not sure this condition is needed, it is only a subcategory of the final else
         elif all([isinstance(x, dict) for x in result]):
             result = [', '.join(["%s: %s" % (k, v) for k, v in order_columns(rec, column_order)]) for rec in result]
         else: