General Ledger Report :
it crashes, the report does not open Nothing appears on the server but the PDF do not opens bzr revid: patelamit2003@gmail.com-20081023104937-0zid1zap38qiq60v
This commit is contained in:
parent
a44bd1d6db
commit
4fa700af44
|
@ -32,6 +32,7 @@ from report import report_sxw
|
|||
import xml
|
||||
import rml_parse
|
||||
import pooler
|
||||
from osv import osv
|
||||
|
||||
class general_ledger(rml_parse.rml_parse):
|
||||
_name = 'report.account.general.ledger'
|
||||
|
@ -135,9 +136,12 @@ class general_ledger(rml_parse.rml_parse):
|
|||
|
||||
for child_id in self.pool.get('account.account').search(self.cr, self.uid,
|
||||
[('parent_id', 'child_of', [account.id])]):
|
||||
|
||||
child_account = self.pool.get('account.account').browse(self.cr, self.uid, child_id)
|
||||
|
||||
sold_account = self._sum_solde_account(child_account,form)
|
||||
self.sold_accounts[child_account.id] = sold_account
|
||||
|
||||
if form['display_account'] == 'bal_mouvement':
|
||||
if child_account.type != 'view' \
|
||||
and len(self.pool.get('account.move.line').search(self.cr, self.uid,
|
||||
|
@ -163,7 +167,6 @@ class general_ledger(rml_parse.rml_parse):
|
|||
|
||||
|
||||
## We will now compute solde initiaux
|
||||
|
||||
for move in res:
|
||||
|
||||
SOLDEINIT = "SELECT sum(l.debit) AS sum_debit, sum(l.credit) AS sum_credit FROM account_move_line l WHERE l.account_id = " + str(move.id) + " AND l.date <= '" + self.borne_date['max_date'] + "'" + " AND l.date >= '" + self.borne_date['min_date'] + "'"
|
||||
|
@ -188,7 +191,7 @@ class general_ledger(rml_parse.rml_parse):
|
|||
else:
|
||||
move.init_credit = 0
|
||||
move.init_debit = 0
|
||||
|
||||
|
||||
##
|
||||
|
||||
return res
|
||||
|
|
|
@ -145,6 +145,20 @@ def _check_date(self, cr, uid, data, context):
|
|||
raise wizard.except_wizard('UserError','Date not in a defined fiscal year')
|
||||
|
||||
def _check_state(self, cr, uid, data, context):
|
||||
print"data",data
|
||||
my_ids=data['ids']
|
||||
if data['model']!='account.account':
|
||||
my_ids=[data['form']['Account_list']]
|
||||
|
||||
child_ids = pooler.get_pool(cr.dbname).get('account.account').search(cr, uid,[('parent_id', 'child_of',my_ids )])
|
||||
|
||||
for child in child_ids :
|
||||
child_account = pooler.get_pool(cr.dbname).get('account.account').browse(cr, uid, child)
|
||||
res = pooler.get_pool(cr.dbname).get('account.move.line').search(cr, uid,[('account_id','=',child_account.id)])
|
||||
print"res",res
|
||||
if not len(res):
|
||||
raise wizard.except_wizard('UserError',"Make sure the account you select has children accounts.")
|
||||
|
||||
if data['form']['state'] == 'bydate':
|
||||
data['form']['fiscalyear'] = False
|
||||
else :
|
||||
|
@ -190,7 +204,7 @@ class wizard_report(wizard.interface):
|
|||
'result': {'type':'choice','next_state':_check}
|
||||
},
|
||||
'report_landscape': {
|
||||
'actions': [],
|
||||
'actions': [_check_state],
|
||||
'result': {'type':'print', 'report':'account.general.ledger_landscape', 'state':'end'}
|
||||
},
|
||||
'report': {
|
||||
|
|
Loading…
Reference in New Issue