Skip to content

Commit

Permalink
Merge pull request odoo#60 from ingadhoc/fix_partner_account_summary
Browse files Browse the repository at this point in the history
FIX partner account summary
  • Loading branch information
jjscarafia committed Jun 18, 2015
2 parents dd186d2 + e082e71 commit 5a9741e
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions account_partner_account_summary/report/account_summary_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,22 +270,21 @@ def get_invoice_line_name(self, line):

def get_initial_credit(self, partner, context=None):
if not context:
context={}
context = {}
if not self.from_date:
return 0.0

if self.result_selection == 'customer':
account_type = ('receivable',)
account_type = ['receivable']
elif self.result_selection == 'supplier':
account_type = ('payable',)
account_type = ['payable']
else:
account_type = ('payable', 'receivable')
account_type = ['payable', 'receivable']

sql_stm = 'SELECT sum(l.credit) ' \
'FROM account_move_line l, account_move m, account_account a '\
'WHERE l.move_id = m.id ' \
'AND l.account_id = a.id ' \
'AND l.partner_id = %s' \
'AND l.partner_id = %s ' \
'AND a.type IN %s ' \
'AND m.date < \'%s\'' \
% (partner.id, account_type, self.from_date)
Expand All @@ -301,16 +300,15 @@ def get_initial_credit(self, partner, context=None):

def get_initial_debit(self, partner, context=None):
if not context:
context={}
context = {}
if not self.from_date:
return 0.0

if self.result_selection == 'customer':
account_type = ('receivable',)
account_type = ['receivable']
elif self.result_selection == 'supplier':
account_type = ('payable',)
account_type = ['payable']
else:
account_type = ('payable', 'receivable')
account_type = ['payable', 'receivable']

sql_stm = 'SELECT sum(l.debit) ' \
'FROM account_move_line l, account_move m, account_account a '\
Expand Down

0 comments on commit 5a9741e

Please sign in to comment.