2009-10-13 05:58:37 +00:00
# -*- coding: utf-8 -*-
2006-12-07 13:41:40 +00:00
##############################################################################
2009-11-30 10:24:22 +00:00
#
2008-11-04 12:48:01 +00:00
# OpenERP, Open Source Management Solution
2010-01-12 09:18:39 +00:00
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
2006-12-07 13:41:40 +00:00
#
2008-11-03 19:18:56 +00:00
# This program is free software: you can redistribute it and/or modify
2009-10-14 11:15:34 +00:00
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
2006-12-07 13:41:40 +00:00
#
2008-11-03 19:18:56 +00:00
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2009-10-14 11:15:34 +00:00
# GNU Affero General Public License for more details.
2006-12-07 13:41:40 +00:00
#
2009-10-14 11:15:34 +00:00
# You should have received a copy of the GNU Affero General Public License
2009-11-30 10:24:22 +00:00
# along with this program. If not, see <http://www.gnu.org/licenses/>.
2006-12-07 13:41:40 +00:00
#
##############################################################################
2010-08-02 08:15:17 +00:00
2006-12-07 13:41:40 +00:00
import time
2008-10-06 09:46:37 +00:00
import re
2010-07-28 06:10:50 +00:00
import copy
2010-07-13 07:35:45 +00:00
2006-12-07 13:41:40 +00:00
from report import report_sxw
2010-07-14 12:54:18 +00:00
from common_report_header import common_report_header
2006-12-07 13:41:40 +00:00
2010-07-14 12:54:18 +00:00
class partner_balance ( report_sxw . rml_parse , common_report_header ) :
2010-07-27 11:01:43 +00:00
2010-07-14 04:37:02 +00:00
def __init__ ( self , cr , uid , name , context = None ) :
if context is None :
context = { }
2009-10-09 11:49:00 +00:00
super ( partner_balance , self ) . __init__ ( cr , uid , name , context = context )
2010-07-14 04:37:02 +00:00
self . account_ids = [ ]
2008-07-22 15:11:28 +00:00
self . localcontext . update ( {
' time ' : time ,
' lines ' : self . lines ,
' sum_debit ' : self . _sum_debit ,
' sum_credit ' : self . _sum_credit ,
' sum_litige ' : self . _sum_litige ,
' sum_sdebit ' : self . _sum_sdebit ,
' sum_scredit ' : self . _sum_scredit ,
' solde_debit ' : self . _solde_balance_debit ,
' solde_credit ' : self . _solde_balance_credit ,
' get_currency ' : self . _get_currency ,
2008-10-06 09:46:37 +00:00
' comma_me ' : self . comma_me ,
2010-07-13 07:35:45 +00:00
' get_fiscalyear ' : self . _get_fiscalyear ,
2010-06-29 13:48:46 +00:00
' get_periods ' : self . get_periods ,
2010-07-19 05:44:42 +00:00
' get_journal ' : self . _get_journal ,
2010-07-27 11:01:43 +00:00
' get_filter ' : self . _get_filter ,
2010-07-19 05:44:42 +00:00
' get_account ' : self . _get_account ,
2010-07-19 10:50:07 +00:00
' get_start_date ' : self . _get_start_date ,
' get_end_date ' : self . _get_end_date ,
2010-07-22 05:36:54 +00:00
' get_start_period ' : self . get_start_period ,
2010-07-27 11:01:43 +00:00
' get_end_period ' : self . get_end_period ,
2010-07-22 06:00:46 +00:00
' get_partners ' : self . _get_partners ,
2008-07-22 15:11:28 +00:00
} )
2008-10-06 09:46:37 +00:00
## Compute account list one time
#
# Date Management
#
2010-07-13 07:35:45 +00:00
2010-06-29 13:48:46 +00:00
def get_periods ( self , form ) :
2010-07-30 09:30:28 +00:00
result = ' '
if form . has_key ( ' periods ' ) and form [ ' periods ' ] :
period_ids = form [ ' periods ' ]
per_ids = self . pool . get ( ' account.period ' ) . browse ( self . cr , self . uid , form [ ' periods ' ] )
for r in per_ids :
if r == per_ids [ len ( per_ids ) - 1 ] :
2010-08-03 04:25:54 +00:00
result + = r . name + " . "
2010-07-30 09:30:28 +00:00
else :
2010-08-03 04:25:54 +00:00
result + = r . name + " , "
2008-10-06 09:46:37 +00:00
else :
2010-07-30 09:30:28 +00:00
fy_obj = self . pool . get ( ' account.fiscalyear ' ) . browse ( self . cr , self . uid , form [ ' fiscalyear ' ] )
res = fy_obj . period_ids
len_res = len ( res )
for r in res :
if r == res [ len_res - 1 ] :
result + = r . name + " . "
else :
result + = r . name + " , "
return str ( result and result [ : - 1 ] ) or ' ALL '
2008-11-04 12:48:01 +00:00
2010-06-16 11:51:39 +00:00
def comma_me ( self , amount ) :
2010-07-30 09:30:28 +00:00
if type ( amount ) is float :
2008-10-06 09:46:37 +00:00
amount = str ( ' %.2f ' % amount )
else :
amount = str ( amount )
if ( amount == ' 0 ' ) :
return ' '
orig = amount
new = re . sub ( " ^(-? \ d+)( \ d {3} ) " , " \ g<1> ' \ g<2> " , amount )
if orig == new :
return new
else :
return self . comma_me ( new )
2008-11-04 12:48:01 +00:00
2010-07-14 04:37:02 +00:00
def set_context ( self , objects , data , ids , report_type = None ) :
2008-10-06 09:46:37 +00:00
## Compute Code
#
2010-09-14 12:07:27 +00:00
# self.initial_balance = data['form'].get('initial_balance', True)
self . display_partner = data [ ' form ' ] . get ( ' display_partner ' , ' non-zero_balance ' )
2010-08-03 04:25:54 +00:00
self . query = data [ ' form ' ] . get ( ' query_line ' , ' ' )
self . init_query = data [ ' form ' ] . get ( ' initial_bal_query ' , ' ' )
self . result_selection = data [ ' form ' ] . get ( ' result_selection ' )
2010-09-14 12:07:27 +00:00
2010-08-03 04:25:54 +00:00
if ( self . result_selection == ' customer ' ) :
2010-06-10 13:34:19 +00:00
self . ACCOUNT_TYPE = ( ' receivable ' , )
2010-08-03 04:25:54 +00:00
elif ( self . result_selection == ' supplier ' ) :
2010-06-10 13:34:19 +00:00
self . ACCOUNT_TYPE = ( ' payable ' , )
2008-10-06 09:46:37 +00:00
else :
2010-08-02 08:15:17 +00:00
self . ACCOUNT_TYPE = ( ' payable ' , ' receivable ' )
2010-08-03 04:25:54 +00:00
2008-11-03 12:50:38 +00:00
self . cr . execute ( " SELECT a.id " \
" FROM account_account a " \
" LEFT JOIN account_account_type t " \
" ON (a.type = t.code) " \
2010-07-13 07:35:45 +00:00
" WHERE a.type IN %s " \
" AND a.active " , ( self . ACCOUNT_TYPE , ) )
2009-11-30 10:24:22 +00:00
self . account_ids = [ a for ( a , ) in self . cr . fetchall ( ) ]
2010-08-03 04:25:54 +00:00
return super ( partner_balance , self ) . set_context ( objects , data , ids , report_type = report_type )
2008-10-06 09:46:37 +00:00
2010-08-03 04:44:02 +00:00
def lines ( self ) :
2008-10-06 09:46:37 +00:00
full_account = [ ]
result_tmp = 0.0
2010-07-30 08:57:46 +00:00
self . cr . execute (
2010-08-02 08:12:43 +00:00
" SELECT p.ref,l.account_id,ac.name AS account_name,ac.code AS code ,p.name, sum(debit) AS debit, sum(credit) AS credit, " \
2010-07-30 08:57:46 +00:00
" CASE WHEN sum(debit) > sum(credit) " \
" THEN sum(debit) - sum(credit) " \
" ELSE 0 " \
" END AS sdebit, " \
" CASE WHEN sum(debit) < sum(credit) " \
" THEN sum(credit) - sum(debit) " \
" ELSE 0 " \
" END AS scredit, " \
" (SELECT sum(debit-credit) " \
" FROM account_move_line l " \
" WHERE partner_id = p.id " \
" AND " + self . query + " " \
" AND blocked = TRUE " \
" ) AS enlitige " \
" FROM account_move_line l LEFT JOIN res_partner p ON (l.partner_id=p.id) " \
" JOIN account_account ac ON (l.account_id = ac.id) " \
" WHERE ac.type IN %s " \
2010-08-03 04:25:54 +00:00
" AND " + self . query + " " \
2010-07-30 08:57:46 +00:00
" GROUP BY p.id, p.ref, p.name,l.account_id,ac.name,ac.code " \
" ORDER BY l.account_id,p.name " ,
( self . ACCOUNT_TYPE , ) )
res = self . cr . dictfetchall ( )
#For include intial balance..
2010-09-14 12:07:27 +00:00
# if self.initial_balance:
# self.cr.execute(
# "SELECT '1' AS type, '' AS ref, l.account_id AS account_id, '' AS account_name, '' AS code, '' AS name, sum(debit) AS debit, sum(credit) AS credit, " \
# "CASE WHEN sum(debit) > sum(credit) " \
# "THEN sum(debit) - sum(credit) " \
# "ELSE 0 " \
# "END AS sdebit, " \
# "CASE WHEN sum(debit) < sum(credit) " \
# "THEN sum(credit) - sum(debit) " \
# "ELSE 0 " \
# "END AS scredit, " \
# "(SELECT sum(debit-credit) " \
# "FROM account_move_line l " \
# "WHERE partner_id = p.id " \
# " AND " + self.init_query + " " \
# "AND blocked = TRUE " \
# ") AS enlitige " \
# "FROM account_move_line l LEFT JOIN res_partner p ON (l.partner_id=p.id) " \
# "JOIN account_account ac ON (l.account_id = ac.id) " \
# "WHERE ac.type IN %s " \
# "AND " + self.init_query + "" \
# "GROUP BY p.id, p.ref, p.name,l.account_id,ac.name,ac.code " \
# "ORDER BY l.account_id, p.name",
# (self.ACCOUNT_TYPE, ))
# res1 = self.cr.dictfetchall()
# final_init = {}
# res_init = {}
# debit = credit = 0
# for r in res1:
# if final_init.get(r['account_id'], False):
# res_init = final_init[r['account_id']]
# debit += final_init[r['account_id']]['debit']
# credit += final_init[r['account_id']]['credit']
# res_init['credit'] = credit
# res_init['debit'] = debit
# res_init['type'] = 3
# res_init['ref'] = ''
# res_init['code'] = ''
# res_init['name'] = 'Initial Balance'
# res_init['balance'] = debit - credit
# res_init['enlitige'] = 0.0 # fix me
# res_init['account_id'] = final_init[r['account_id']]['account_id']
# else:
# res_init = {}
# debit = r['debit']
# credit = r['credit']
# res_init['credit'] = credit
# res_init['debit'] = debit
# res_init['type'] = 3
# res_init['ref'] = ''
# res_init['code'] = ''
# res_init['name'] = 'Initial Balance'
# res_init['balance'] = debit - credit
# res_init['enlitige'] = 0.0 # fix me
# res_init['account_id'] = r['account_id']
# final_init[r['account_id']] = res_init
2010-09-01 05:04:20 +00:00
if self . display_partner == ' non-zero_balance ' :
full_account = [ r for r in res if r [ ' sdebit ' ] > 0 or r [ ' scredit ' ] > 0 ]
else :
full_account = [ r for r in res ]
2010-09-15 11:51:58 +00:00
for rec in full_account :
if not rec . get ( ' name ' , False ) :
rec . update ( { ' name ' : ' No Partner Defined ' } )
2008-10-06 09:46:37 +00:00
## We will now compute Total
2010-07-27 11:01:43 +00:00
subtotal_row = self . _add_subtotal ( full_account )
2010-09-14 12:07:27 +00:00
# if not self.initial_balance:
# return subtotal_row
#
# #If include initial balance is selected..
# subtotal = copy.deepcopy(subtotal_row)
# init_acnt = []
# for row in subtotal_row:
# if final_init and row.get('account_id', False) and not row['account_id'] in init_acnt and final_init.get(row['account_id'], False):
# subtotal.insert(subtotal.index(row), final_init[row['account_id']])
# init_acnt.append(row['account_id'])
return subtotal_row
2008-01-11 14:46:53 +00:00
2010-06-16 11:51:39 +00:00
def _add_subtotal ( self , cleanarray ) :
2010-07-27 11:01:43 +00:00
i = 0
2008-10-06 09:46:37 +00:00
completearray = [ ]
tot_debit = 0.0
tot_credit = 0.0
tot_scredit = 0.0
tot_sdebit = 0.0
tot_enlitige = 0.0
for r in cleanarray :
# For the first element we always add the line
# type = 1 is the line is the first of the account
# type = 2 is an other line of the account
if i == 0 :
# We add the first as the header
#
##
new_header = { }
new_header [ ' ref ' ] = ' '
new_header [ ' name ' ] = r [ ' account_name ' ]
new_header [ ' code ' ] = r [ ' code ' ]
2010-07-28 10:08:49 +00:00
new_header [ ' debit ' ] = r [ ' credit ' ] #tot_credit
new_header [ ' credit ' ] = r [ ' debit ' ] #tot_debit
2008-10-15 13:15:46 +00:00
new_header [ ' scredit ' ] = tot_scredit
new_header [ ' sdebit ' ] = tot_sdebit
new_header [ ' enlitige ' ] = tot_enlitige
new_header [ ' balance ' ] = float ( tot_sdebit ) - float ( tot_scredit )
2008-10-06 09:46:37 +00:00
new_header [ ' type ' ] = 3
##
completearray . append ( new_header )
#
r [ ' type ' ] = 1
r [ ' balance ' ] = float ( r [ ' sdebit ' ] ) - float ( r [ ' scredit ' ] )
2008-11-04 12:48:01 +00:00
2008-10-06 09:46:37 +00:00
completearray . append ( r )
#
tot_debit = r [ ' debit ' ]
tot_credit = r [ ' credit ' ]
tot_scredit = r [ ' scredit ' ]
tot_sdebit = r [ ' sdebit ' ]
tot_enlitige = ( r [ ' enlitige ' ] or 0.0 )
#
else :
if cleanarray [ i ] [ ' account_id ' ] < > cleanarray [ i - 1 ] [ ' account_id ' ] :
2008-11-04 12:48:01 +00:00
2008-10-15 13:15:46 +00:00
new_header [ ' debit ' ] = tot_debit
new_header [ ' credit ' ] = tot_credit
new_header [ ' scredit ' ] = tot_scredit
new_header [ ' sdebit ' ] = tot_sdebit
new_header [ ' enlitige ' ] = tot_enlitige
new_header [ ' balance ' ] = float ( tot_sdebit ) - float ( tot_scredit )
new_header [ ' type ' ] = 3
2008-11-04 12:48:01 +00:00
# we reset the counter
2008-10-06 09:46:37 +00:00
tot_debit = r [ ' debit ' ]
tot_credit = r [ ' credit ' ]
tot_scredit = r [ ' scredit ' ]
tot_sdebit = r [ ' sdebit ' ]
tot_enlitige = ( r [ ' enlitige ' ] or 0.0 )
#
##
new_header = { }
new_header [ ' ref ' ] = ' '
new_header [ ' name ' ] = r [ ' account_name ' ]
new_header [ ' code ' ] = r [ ' code ' ]
2008-10-15 13:15:46 +00:00
new_header [ ' debit ' ] = tot_debit
new_header [ ' credit ' ] = tot_credit
new_header [ ' scredit ' ] = tot_scredit
new_header [ ' sdebit ' ] = tot_sdebit
new_header [ ' enlitige ' ] = tot_enlitige
new_header [ ' balance ' ] = float ( tot_sdebit ) - float ( tot_scredit )
2008-10-06 09:46:37 +00:00
new_header [ ' type ' ] = 3
2010-06-29 13:48:46 +00:00
##get_fiscalyear
2008-10-06 09:46:37 +00:00
##
2008-11-06 11:22:44 +00:00
2008-10-06 09:46:37 +00:00
completearray . append ( new_header )
2008-11-04 12:48:01 +00:00
##
2008-10-06 09:46:37 +00:00
#
r [ ' type ' ] = 1
#
r [ ' balance ' ] = float ( r [ ' sdebit ' ] ) - float ( r [ ' scredit ' ] )
2008-11-04 12:48:01 +00:00
2008-10-06 09:46:37 +00:00
completearray . append ( r )
2008-11-04 12:48:01 +00:00
2008-10-06 09:46:37 +00:00
if cleanarray [ i ] [ ' account_id ' ] == cleanarray [ i - 1 ] [ ' account_id ' ] :
2008-11-04 12:48:01 +00:00
# we reset the counter
new_header [ ' debit ' ] = tot_debit
new_header [ ' credit ' ] = tot_credit
new_header [ ' scredit ' ] = tot_scredit
new_header [ ' sdebit ' ] = tot_sdebit
new_header [ ' enlitige ' ] = tot_enlitige
new_header [ ' balance ' ] = float ( tot_sdebit ) - float ( tot_scredit )
new_header [ ' type ' ] = 3
2008-10-06 09:46:37 +00:00
tot_debit = tot_debit + r [ ' debit ' ]
tot_credit = tot_credit + r [ ' credit ' ]
tot_scredit = tot_scredit + r [ ' scredit ' ]
tot_sdebit = tot_sdebit + r [ ' sdebit ' ]
tot_enlitige = tot_enlitige + ( r [ ' enlitige ' ] or 0.0 )
2008-11-04 12:48:01 +00:00
new_header [ ' debit ' ] = tot_debit
new_header [ ' credit ' ] = tot_credit
new_header [ ' scredit ' ] = tot_scredit
new_header [ ' sdebit ' ] = tot_sdebit
new_header [ ' enlitige ' ] = tot_enlitige
new_header [ ' balance ' ] = float ( tot_sdebit ) - float ( tot_scredit )
2008-10-06 09:46:37 +00:00
#
r [ ' type ' ] = 2
#
r [ ' balance ' ] = float ( r [ ' sdebit ' ] ) - float ( r [ ' scredit ' ] )
#
2008-11-06 11:22:44 +00:00
2008-10-06 09:46:37 +00:00
completearray . append ( r )
2008-11-04 12:48:01 +00:00
2008-10-06 09:46:37 +00:00
i = i + 1
return completearray
2010-08-03 04:44:02 +00:00
def _sum_debit ( self ) :
2008-07-22 15:11:28 +00:00
if not self . ids :
return 0.0
2009-01-13 05:47:41 +00:00
temp_res = 0.0
2010-07-30 09:30:28 +00:00
self . cr . execute (
" SELECT sum(debit) " \
" FROM account_move_line AS l " \
" WHERE l.account_id IN %s " \
" AND " + self . query + " " ,
( tuple ( self . account_ids ) , ) )
temp_res = float ( self . cr . fetchone ( ) [ 0 ] or 0.0 )
2010-09-14 12:07:27 +00:00
# if self.initial_balance:
# self.cr.execute(
# "SELECT sum(debit) " \
# "FROM account_move_line AS l " \
# "WHERE l.account_id IN %s " \
# "AND " + self.init_query + "" ,
# (tuple(self.account_ids), ))
# temp_res += float(self.cr.fetchone()[0] or 0.0)
2010-07-30 09:30:28 +00:00
return temp_res
2008-01-11 14:46:53 +00:00
2010-08-03 04:44:02 +00:00
def _sum_credit ( self ) :
2008-07-22 15:11:28 +00:00
if not self . ids :
return 0.0
2009-01-13 05:47:41 +00:00
temp_res = 0.0
2010-07-30 09:30:28 +00:00
self . cr . execute (
" SELECT sum(credit) " \
" FROM account_move_line AS l " \
" WHERE l.account_id IN %s " \
" AND " + self . query + " " ,
( tuple ( self . account_ids ) , ) )
temp_res = float ( self . cr . fetchone ( ) [ 0 ] or 0.0 )
2010-09-14 12:07:27 +00:00
# if self.initial_balance:
# self.cr.execute(
# "SELECT sum(credit) " \
# "FROM account_move_line AS l " \
# "WHERE l.account_id IN %s " \
# "AND " + self.init_query + "" ,
# (tuple(self.account_ids),))
# temp_res += float(self.cr.fetchone()[0] or 0.0)
2010-07-30 09:30:28 +00:00
return temp_res
2006-12-07 13:41:40 +00:00
2010-08-03 04:44:02 +00:00
def _sum_litige ( self ) :
2008-07-22 15:11:28 +00:00
if not self . ids :
return 0.0
2009-01-13 05:47:41 +00:00
temp_res = 0.0
2010-07-30 09:30:28 +00:00
self . cr . execute (
" SELECT sum(debit-credit) " \
" FROM account_move_line AS l " \
" WHERE l.account_id IN %s " \
" AND " + self . query + " " \
" AND l.blocked=TRUE " ,
( tuple ( self . account_ids ) , ) )
temp_res = float ( self . cr . fetchone ( ) [ 0 ] or 0.0 )
2010-09-14 12:07:27 +00:00
# if self.initial_balance:
# self.cr.execute(
# "SELECT sum(debit-credit) " \
# "FROM account_move_line AS l " \
# "WHERE l.account_id IN %s " \
# "AND l.blocked=TRUE "\
# "AND " + self.init_query + "" ,
# (tuple(self.account_ids), ))
# temp_res += float(self.cr.fetchone()[0] or 0.0)
2010-07-30 09:30:28 +00:00
return temp_res
2008-01-11 14:46:53 +00:00
2010-08-03 04:44:02 +00:00
def _sum_sdebit ( self ) :
2008-07-22 15:11:28 +00:00
if not self . ids :
return 0.0
2008-10-06 09:46:37 +00:00
result_tmp = 0.0
2009-01-13 05:47:41 +00:00
a = 0.0
2010-07-30 09:30:28 +00:00
self . cr . execute (
" SELECT CASE WHEN sum(debit) > sum(credit) " \
" THEN sum(debit) - sum(credit) " \
" ELSE 0 " \
" END " \
" FROM account_move_line AS l " \
" WHERE l.account_id IN %s " \
" AND " + self . query + " " \
" GROUP BY l.partner_id " ,
( tuple ( self . account_ids ) , ) )
a = self . cr . fetchone ( ) [ 0 ]
if self . cr . fetchone ( ) != None :
result_tmp = result_tmp + ( a or 0.0 )
else :
result_tmp = 0.0
2008-11-04 12:48:01 +00:00
return result_tmp
2008-01-11 14:46:53 +00:00
2010-08-03 04:44:02 +00:00
def _sum_scredit ( self ) :
2008-07-22 15:11:28 +00:00
if not self . ids :
return 0.0
2008-10-06 09:46:37 +00:00
result_tmp = 0.0
2009-01-13 05:47:41 +00:00
a = 0.0
2010-07-30 09:30:28 +00:00
self . cr . execute (
" SELECT CASE WHEN sum(debit) < sum(credit) " \
" THEN sum(credit) - sum(debit) " \
" ELSE 0 " \
" END " \
" FROM account_move_line AS l " \
" WHERE l.account_id IN %s " \
" AND " + self . query + " " \
" GROUP BY l.partner_id " ,
( tuple ( self . account_ids ) , ) )
a = self . cr . fetchone ( ) [ 0 ] or 0.0
if self . cr . fetchone ( ) != None :
result_tmp = result_tmp + ( a or 0.0 )
else :
result_tmp = 0.0
2008-10-06 09:46:37 +00:00
return result_tmp
2008-11-04 12:48:01 +00:00
2010-08-03 04:44:02 +00:00
def _solde_balance_debit ( self ) :
debit , credit = self . _sum_debit ( ) , self . _sum_credit ( )
2008-07-22 15:11:28 +00:00
return debit > credit and debit - credit
2008-11-04 12:48:01 +00:00
2010-08-03 04:44:02 +00:00
def _solde_balance_credit ( self ) :
debit , credit = self . _sum_debit ( ) , self . _sum_credit ( )
2008-07-22 15:11:28 +00:00
return credit > debit and credit - debit
2007-07-10 15:24:54 +00:00
2010-08-03 04:44:02 +00:00
def _get_partners ( self ) :
2010-08-03 04:25:54 +00:00
if self . result_selection == ' customer ' :
2010-07-22 06:00:46 +00:00
return ' Receivable Accounts '
2010-08-03 04:25:54 +00:00
elif self . result_selection == ' supplier ' :
2010-07-22 06:00:46 +00:00
return ' Payable Accounts '
2010-08-03 04:25:54 +00:00
elif self . result_selection == ' customer_supplier ' :
2010-07-22 06:00:46 +00:00
return ' Receivable and Payable Accounts '
return ' '
2010-07-30 09:30:28 +00:00
2010-08-02 12:34:32 +00:00
report_sxw . report_sxw ( ' report.account.partner.balance ' , ' res.partner ' , ' account/report/account_partner_balance.rml ' , parser = partner_balance , header = " internal " )
2009-04-09 10:02:19 +00:00
2010-07-14 04:37:02 +00:00
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: