general ledger now working in trunk....
bzr revid: patelamit2003@gmail.com-20080926064944-5bu1n4j6n06txucr
This commit is contained in:
parent
125c8d7ba8
commit
87cd7aee3b
|
@ -141,7 +141,9 @@ class account_account(osv.osv):
|
|||
if context is None:
|
||||
context = {}
|
||||
pos = 0
|
||||
|
||||
while pos<len(args):
|
||||
|
||||
if args[pos][0]=='code' and args[pos][1] in ('like','ilike') and args[pos][2]:
|
||||
args[pos] = ('code', '=like', str(args[pos][2].replace('%',''))+'%')
|
||||
if args[pos][0]=='journal_id':
|
||||
|
@ -157,6 +159,7 @@ class account_account(osv.osv):
|
|||
ids1 += map(lambda x: x.id, jour.account_control_ids)
|
||||
args[pos] = ('id','in',ids1)
|
||||
pos+=1
|
||||
|
||||
return super(account_account,self).search(cr, uid, args, offset, limit,
|
||||
order, context=context, count=count)
|
||||
|
||||
|
|
|
@ -148,7 +148,7 @@ class general_ledger_landscape(rml_parse.rml_parse):
|
|||
|
||||
self.child_ids = self.pool.get('account.account').search(self.cr, self.uid,
|
||||
[('parent_id', 'child_of', self.ids)])
|
||||
print"======account.id====",account.id
|
||||
#
|
||||
res = []
|
||||
ctx = self.context.copy()
|
||||
## We will make the test for period or date
|
||||
|
@ -163,9 +163,9 @@ class general_ledger_landscape(rml_parse.rml_parse):
|
|||
##
|
||||
|
||||
#
|
||||
print"account",account
|
||||
self.query = self.pool.get('account.move.line')._query_get(self.cr, self.uid, context=ctx)
|
||||
for child_id in account.search(self.cr, self.uid,[('parent_id', 'child_of', [account.id])]):
|
||||
|
||||
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
|
||||
|
|
|
@ -187,7 +187,7 @@ class third_party_ledger(rml_parse.rml_parse):
|
|||
"LEFT JOIN account_journal j " \
|
||||
"ON (l.journal_id = j.id) " \
|
||||
"WHERE l.partner_id = %d " \
|
||||
"AND l.account_id IN (" + self.account_ids + ") " \
|
||||
# "AND l.account_id IN (" + self.account_ids + ") " \
|
||||
"AND l.date < %s " \
|
||||
"AND l.reconcile_id IS NULL "
|
||||
"ORDER BY l.id",
|
||||
|
@ -205,7 +205,7 @@ class third_party_ledger(rml_parse.rml_parse):
|
|||
"LEFT JOIN account_journal j " \
|
||||
"ON (l.journal_id = j.id) " \
|
||||
"WHERE l.partner_id = %d " \
|
||||
"AND l.account_id IN (" + self.account_ids + ") " \
|
||||
# "AND l.account_id IN (" + self.account_ids + ") " \
|
||||
"AND l.date IN (" + self.date_lst_string + ") " \
|
||||
" " + RECONCILE_TAG + " "\
|
||||
"ORDER BY l.id",
|
||||
|
@ -270,7 +270,7 @@ class third_party_ledger(rml_parse.rml_parse):
|
|||
"SELECT sum(credit) " \
|
||||
"FROM account_move_line " \
|
||||
"WHERE partner_id=%d " \
|
||||
"AND account_id IN (" + self.account_ids + ") " \
|
||||
# "AND account_id IN (" + self.account_ids + ") " \
|
||||
"AND reconcile_id IS NULL " \
|
||||
"AND date < %s " ,
|
||||
(partner.id,self.date_lst[0],))
|
||||
|
@ -284,7 +284,7 @@ class third_party_ledger(rml_parse.rml_parse):
|
|||
"SELECT sum(credit) " \
|
||||
"FROM account_move_line " \
|
||||
"WHERE partner_id=%d " \
|
||||
"AND account_id IN (" + self.account_ids + ") " \
|
||||
# "AND account_id IN (" + self.account_ids + ") " \
|
||||
" " + RECONCILE_TAG + " " \
|
||||
"AND date IN (" + self.date_lst_string + ") " ,
|
||||
(partner.id,))
|
||||
|
@ -310,7 +310,7 @@ class third_party_ledger(rml_parse.rml_parse):
|
|||
"SELECT sum(debit) " \
|
||||
"FROM account_move_line " \
|
||||
"WHERE partner_id IN (" + self.partner_ids + ") " \
|
||||
"AND account_id IN (" + self.account_ids + ") " \
|
||||
# "AND account_id IN (" + self.account_ids + ") " \
|
||||
"AND reconcile_id IS NULL " \
|
||||
"AND date < %s " ,
|
||||
(self.date_lst[0],))
|
||||
|
@ -324,7 +324,7 @@ class third_party_ledger(rml_parse.rml_parse):
|
|||
"SELECT sum(debit) " \
|
||||
"FROM account_move_line " \
|
||||
"WHERE partner_id IN (" + self.partner_ids + ") " \
|
||||
"AND account_id IN (" + self.account_ids + ") " \
|
||||
# "AND account_id IN (" + self.account_ids + ") " \
|
||||
" " + RECONCILE_TAG + " " \
|
||||
"AND date IN (" + self.date_lst_string + ") "
|
||||
)
|
||||
|
@ -352,7 +352,7 @@ class third_party_ledger(rml_parse.rml_parse):
|
|||
"SELECT sum(credit) " \
|
||||
"FROM account_move_line " \
|
||||
"WHERE partner_id IN (" + self.partner_ids + ") " \
|
||||
"AND account_id IN (" + self.account_ids + ") " \
|
||||
# "AND account_id IN (" + self.account_ids + ") " \
|
||||
"AND reconcile_id IS NULL " \
|
||||
"AND date < %s " ,
|
||||
(self.date_lst[0],))
|
||||
|
@ -365,7 +365,7 @@ class third_party_ledger(rml_parse.rml_parse):
|
|||
"SELECT sum(credit) " \
|
||||
"FROM account_move_line " \
|
||||
"WHERE partner_id IN (" + self.partner_ids + ") " \
|
||||
"AND account_id IN (" + self.account_ids + ") " \
|
||||
# "AND account_id IN (" + self.account_ids + ") " \
|
||||
" " + RECONCILE_TAG + " " \
|
||||
"AND date IN (" + self.date_lst_string + ") "
|
||||
)
|
||||
|
@ -384,6 +384,6 @@ class third_party_ledger(rml_parse.rml_parse):
|
|||
return pooler.get_pool(self.cr.dbname).get('res.company').browse(self.cr, self.uid, form['company_id']).currency_id.name
|
||||
|
||||
report_sxw.report_sxw('report.account.third_party_ledger', 'res.partner',
|
||||
'addons/account/third_party_ledger.rml',parser=third_party_ledger,
|
||||
'addons/account/report/third_party_ledger.rml',parser=third_party_ledger,
|
||||
header=False)
|
||||
|
||||
|
|
Loading…
Reference in New Issue