From 47ca43936e320a22730dd15b687533614ad8f2f6 Mon Sep 17 00:00:00 2001 From: Nicolas Mac Rouillon Date: Wed, 3 Jun 2015 11:25:02 -0300 Subject: [PATCH 1/3] FIX partner account summary --- .../report/account_summary_parser.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/account_partner_account_summary/report/account_summary_parser.py b/account_partner_account_summary/report/account_summary_parser.py index e0e7007a..5abce414 100755 --- a/account_partner_account_summary/report/account_summary_parser.py +++ b/account_partner_account_summary/report/account_summary_parser.py @@ -81,6 +81,7 @@ def __init__(self, cr, uid, name, context): 'get_final_balance': self.get_final_balance, 'get_invoice': self.get_invoice, }) + print 'dsdssdfds' def get_moves_from_partner(self, dic, partner): return dic[partner] @@ -270,22 +271,22 @@ 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') + print 'account_type', account_type 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) @@ -301,17 +302,17 @@ 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') + print 'account_type', account_type sql_stm = 'SELECT sum(l.debit) ' \ 'FROM account_move_line l, account_move m, account_account a '\ 'WHERE l.move_id = m.id ' \ From 799714f3f7deb074db849210fdcf19ea51df66aa Mon Sep 17 00:00:00 2001 From: Nicolas Mac Rouillon Date: Wed, 3 Jun 2015 11:32:06 -0300 Subject: [PATCH 2/3] FIX --- .../report/account_summary_parser.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/account_partner_account_summary/report/account_summary_parser.py b/account_partner_account_summary/report/account_summary_parser.py index 5abce414..294b8a69 100755 --- a/account_partner_account_summary/report/account_summary_parser.py +++ b/account_partner_account_summary/report/account_summary_parser.py @@ -81,7 +81,6 @@ def __init__(self, cr, uid, name, context): 'get_final_balance': self.get_final_balance, 'get_invoice': self.get_invoice, }) - print 'dsdssdfds' def get_moves_from_partner(self, dic, partner): return dic[partner] @@ -280,7 +279,6 @@ def get_initial_credit(self, partner, context=None): account_type = ('payable', '') else: account_type = ('payable', 'receivable') - print 'account_type', account_type sql_stm = 'SELECT sum(l.credit) ' \ 'FROM account_move_line l, account_move m, account_account a '\ @@ -312,7 +310,6 @@ def get_initial_debit(self, partner, context=None): else: account_type = ('payable', 'receivable') - print 'account_type', account_type sql_stm = 'SELECT sum(l.debit) ' \ 'FROM account_move_line l, account_move m, account_account a '\ 'WHERE l.move_id = m.id ' \ From e082e7160e93f4ad7142888050e3b975da8c94c4 Mon Sep 17 00:00:00 2001 From: Juan Jose Scarafia Date: Thu, 18 Jun 2015 13:30:33 -0300 Subject: [PATCH 3/3] IMp account summary fix --- .../report/account_summary_parser.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/account_partner_account_summary/report/account_summary_parser.py b/account_partner_account_summary/report/account_summary_parser.py index 294b8a69..51e5bb74 100755 --- a/account_partner_account_summary/report/account_summary_parser.py +++ b/account_partner_account_summary/report/account_summary_parser.py @@ -274,11 +274,11 @@ def get_initial_credit(self, partner, context=None): 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 '\ @@ -304,11 +304,11 @@ def get_initial_debit(self, partner, context=None): 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 '\