[IMP]: make indian accounting chart compitable with new types

bzr revid: mga@tinyerp.com-20100520152615-envtjv9xy5e4tq6z
This commit is contained in:
Mantavya Gajjar
2010-05-20 20:56:15 +05:30
parent 449c86f579
commit 4b83f4cce4
4 changed files with 583 additions and 544 deletions
+13
View File
@@ -171,6 +171,19 @@ class account_account(osv.osv):
_description = "Account"
_parent_store = True
def _get_children_and_consol(self, cr, uid, ids, context={}):
ids2=[]
temp=[]
read_data= self.read(cr, uid, ids,['id','child_id'], context)
for data in read_data:
ids2.append(data['id'])
if data['child_id']:
temp=[]
for x in data['child_id']:
temp.append(x)
ids2 += self._get_children_and_consol(cr, uid, temp, context)
return ids2
def search(self, cr, uid, args, offset=0, limit=None, order=None,
context=None, count=False):
if context is None:
+14 -13
View File
@@ -104,22 +104,22 @@ class report_balancesheet_horizontal(rml_parse.rml_parse):
else:
self.res_pl['type'] = 'Net Loss'
pl_dict = {
'code' : False,
'name' : self.res_pl['type'],
'level': False,
'balance':self.res_pl['balance'],
}
'code' : False,
'name' : self.res_pl['type'],
'level': False,
'balance':self.res_pl['balance'],
}
for typ in types:
accounts_temp = []
for account in accounts:
if (account.user_type.report_type) and (account.user_type.report_type == typ):
account_dict = {
'id' : account.id,
'code' : account.code,
'name' : account.name,
'level': account.level,
'balance':account.balance,
}
'id' : account.id,
'code' : account.code,
'name' : account.name,
'level': account.level,
'balance':account.balance,
}
if typ == 'liability' and account.type <> 'view' and (account.debit <> account.credit):
self.result_sum_dr += abs(account.debit - account.credit)
if typ == 'asset' and account.type <> 'view' and (account.debit <> account.credit):
@@ -138,6 +138,7 @@ class report_balancesheet_horizontal(rml_parse.rml_parse):
self.result[typ] = accounts_temp
cal_list[typ]=self.result[typ]
print 'XXXXXXXX : ', cal_list, len(cal_list)
if cal_list:
temp={}
for i in range(0,max(len(cal_list['liability']),len(cal_list['asset']))):
@@ -164,7 +165,7 @@ class report_balancesheet_horizontal(rml_parse.rml_parse):
'name1' : cal_list['asset'][i]['name'],
'level1': cal_list['asset'][i]['level'],
'balance1':cal_list['asset'][i]['balance'],
}
}
self.result_temp.append(temp)
if i < len(cal_list['liability']):
temp={
@@ -176,7 +177,7 @@ class report_balancesheet_horizontal(rml_parse.rml_parse):
'name1' : '',
'level1': False,
'balance1':False,
}
}
self.result_temp.append(temp)
return None
+1 -1
View File
@@ -34,7 +34,7 @@
"demo_xml" : [],
"update_xml" : [
"account_chart.xml",
"l10n_in_wizard.xml",
"account_wizard.xml",
],
"active": False,
"installable": True
File diff suppressed because it is too large Load Diff