From fe32b72179e1d4229d16493d5285921d327c34c0 Mon Sep 17 00:00:00 2001 From: apa-tiny Date: Tue, 26 Oct 2010 15:05:41 +0530 Subject: [PATCH 01/13] [REM]:account,hr_payroll:remove rml_parse.py file. bzr revid: apa@tinyerp.com-20101026093541-0bze9bqj444gntut --- .../report/account_aged_partner_balance.py | 4 +- addons/account/report/account_balance.py | 1 - .../report/account_balance_landscape.py | 3 +- .../account/report/account_balance_sheet.py | 3 +- .../account/report/account_central_journal.py | 1 - .../account/report/account_general_journal.py | 1 - .../account/report/account_general_ledger.py | 4 +- addons/account/report/account_journal.py | 1 - .../account/report/account_partner_balance.py | 1 - .../account/report/account_partner_ledger.py | 4 +- .../account/report/account_print_overdue.py | 1 - addons/account/report/account_profit_loss.py | 4 +- addons/account/report/account_tax_code.py | 3 +- addons/account/report/account_tax_report.py | 4 +- .../account/report/account_voucher_print.py | 1 - addons/account/report/rml_parse.py | 150 ----------------- addons/account_voucher/report/rml_parse.py | 150 ----------------- .../report/report_employees_detail.py | 3 +- .../report/report_payroll_advice.py | 1 - addons/hr_payroll/report/report_payslip.py | 1 - .../hr_payroll/report/report_year_salary.py | 3 +- addons/hr_payroll/report/rml_parse.py | 154 ------------------ 22 files changed, 10 insertions(+), 488 deletions(-) delete mode 100644 addons/account/report/rml_parse.py delete mode 100644 addons/account_voucher/report/rml_parse.py delete mode 100755 addons/hr_payroll/report/rml_parse.py diff --git a/addons/account/report/account_aged_partner_balance.py b/addons/account/report/account_aged_partner_balance.py index 879560a5b4a..b99070330f7 100644 --- a/addons/account/report/account_aged_partner_balance.py +++ b/addons/account/report/account_aged_partner_balance.py @@ -20,12 +20,10 @@ ############################################################################## import time - -import rml_parse from report import report_sxw from common_report_header import common_report_header -class aged_trial_report(rml_parse.rml_parse, common_report_header): +class aged_trial_report(report_sxw.rml_parse, common_report_header): def __init__(self, cr, uid, name, context): super(aged_trial_report, self).__init__(cr, uid, name, context=context) diff --git a/addons/account/report/account_balance.py b/addons/account/report/account_balance.py index 5a6c7700b9d..f9697710f8f 100644 --- a/addons/account/report/account_balance.py +++ b/addons/account/report/account_balance.py @@ -20,7 +20,6 @@ ############################################################################## import time - from report import report_sxw from common_report_header import common_report_header diff --git a/addons/account/report/account_balance_landscape.py b/addons/account/report/account_balance_landscape.py index 6ec7ec7c10e..8576850ff5e 100644 --- a/addons/account/report/account_balance_landscape.py +++ b/addons/account/report/account_balance_landscape.py @@ -22,7 +22,6 @@ import time import locale from report import report_sxw -import rml_parse parents = { 'tr':1, @@ -31,7 +30,7 @@ parents = { 'section': 0 } -class account_balance_landscape(rml_parse.rml_parse): +class account_balance_landscape(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): super(account_balance_landscape, self).__init__(cr, uid, name, context=context) self.flag=1 diff --git a/addons/account/report/account_balance_sheet.py b/addons/account/report/account_balance_sheet.py index 820ddfb473d..7a6d0f06ae7 100644 --- a/addons/account/report/account_balance_sheet.py +++ b/addons/account/report/account_balance_sheet.py @@ -22,12 +22,11 @@ import time import pooler -import rml_parse from report import report_sxw from account.report import account_profit_loss from common_report_header import common_report_header -class report_balancesheet_horizontal(rml_parse.rml_parse, common_report_header): +class report_balancesheet_horizontal(report_sxw.rml_parse, common_report_header): def __init__(self, cr, uid, name, context=None): super(report_balancesheet_horizontal, self).__init__(cr, uid, name, context=context) self.obj_pl = account_profit_loss.report_pl_account_horizontal(cr, uid, name, context=context) diff --git a/addons/account/report/account_central_journal.py b/addons/account/report/account_central_journal.py index 6ab5b38d03d..d3113b63133 100644 --- a/addons/account/report/account_central_journal.py +++ b/addons/account/report/account_central_journal.py @@ -20,7 +20,6 @@ ############################################################################## import time - from report import report_sxw from common_report_header import common_report_header # diff --git a/addons/account/report/account_general_journal.py b/addons/account/report/account_general_journal.py index 4a20ac9ebc4..9eb81157dba 100644 --- a/addons/account/report/account_general_journal.py +++ b/addons/account/report/account_general_journal.py @@ -20,7 +20,6 @@ ############################################################################## import time - from common_report_header import common_report_header from report import report_sxw diff --git a/addons/account/report/account_general_ledger.py b/addons/account/report/account_general_ledger.py index e13604c4219..e498fe1345f 100644 --- a/addons/account/report/account_general_ledger.py +++ b/addons/account/report/account_general_ledger.py @@ -28,12 +28,10 @@ ############################################################################## import time - from report import report_sxw from common_report_header import common_report_header -import rml_parse -class general_ledger(rml_parse.rml_parse, common_report_header): +class general_ledger(report_sxw.rml_parse, common_report_header): _name = 'report.account.general.ledger' def set_context(self, objects, data, ids, report_type=None): diff --git a/addons/account/report/account_journal.py b/addons/account/report/account_journal.py index 2a699b20f84..82af01cdb0b 100644 --- a/addons/account/report/account_journal.py +++ b/addons/account/report/account_journal.py @@ -20,7 +20,6 @@ ############################################################################## import time - from common_report_header import common_report_header from report import report_sxw diff --git a/addons/account/report/account_partner_balance.py b/addons/account/report/account_partner_balance.py index c17de597e1c..8759f11a349 100644 --- a/addons/account/report/account_partner_balance.py +++ b/addons/account/report/account_partner_balance.py @@ -22,7 +22,6 @@ import time import re import copy - from tools.translate import _ from report import report_sxw from common_report_header import common_report_header diff --git a/addons/account/report/account_partner_ledger.py b/addons/account/report/account_partner_ledger.py index 52e012e4460..14fd6335375 100644 --- a/addons/account/report/account_partner_ledger.py +++ b/addons/account/report/account_partner_ledger.py @@ -21,12 +21,10 @@ import time import re - -import rml_parse from report import report_sxw from common_report_header import common_report_header -class third_party_ledger(rml_parse.rml_parse, common_report_header): +class third_party_ledger(report_sxw.rml_parse, common_report_header): def __init__(self, cr, uid, name, context=None): super(third_party_ledger, self).__init__(cr, uid, name, context=context) diff --git a/addons/account/report/account_print_overdue.py b/addons/account/report/account_print_overdue.py index 3e1f0b54de1..2d2b8ed5f94 100644 --- a/addons/account/report/account_print_overdue.py +++ b/addons/account/report/account_print_overdue.py @@ -20,7 +20,6 @@ ############################################################################## import time - import ir from osv import osv from report import report_sxw diff --git a/addons/account/report/account_profit_loss.py b/addons/account/report/account_profit_loss.py index 792b88053a1..ea2f077f843 100644 --- a/addons/account/report/account_profit_loss.py +++ b/addons/account/report/account_profit_loss.py @@ -19,13 +19,11 @@ ############################################################################## import time - import pooler -import rml_parse from report import report_sxw from common_report_header import common_report_header -class report_pl_account_horizontal(rml_parse.rml_parse, common_report_header): +class report_pl_account_horizontal(report_sxw.rml_parse, common_report_header): def __init__(self, cr, uid, name, context=None): super(report_pl_account_horizontal, self).__init__(cr, uid, name, context=context) diff --git a/addons/account/report/account_tax_code.py b/addons/account/report/account_tax_code.py index 2f123fd00be..7d66a955fc8 100644 --- a/addons/account/report/account_tax_code.py +++ b/addons/account/report/account_tax_code.py @@ -22,7 +22,6 @@ import time import pooler -import rml_parse import copy from report import report_sxw import re @@ -46,7 +45,7 @@ def _record_to_report_line(record): 'country': _get_country(record) } -class account_tax_code_report(rml_parse.rml_parse): +class account_tax_code_report(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): super(account_tax_code_report, self).__init__(cr, uid, name, context=context) self.localcontext.update({ diff --git a/addons/account/report/account_tax_report.py b/addons/account/report/account_tax_report.py index c245e735d65..c79139a56cc 100644 --- a/addons/account/report/account_tax_report.py +++ b/addons/account/report/account_tax_report.py @@ -21,12 +21,10 @@ import time import copy - -import rml_parse from report import report_sxw from common_report_header import common_report_header -class tax_report(rml_parse.rml_parse, common_report_header): +class tax_report(report_sxw.rml_parse, common_report_header): _name = 'report.account.vat.declaration' def __init__(self, cr, uid, name, context={}): super(tax_report, self).__init__(cr, uid, name, context=context) diff --git a/addons/account/report/account_voucher_print.py b/addons/account/report/account_voucher_print.py index 44587b3e689..7cf9282148d 100644 --- a/addons/account/report/account_voucher_print.py +++ b/addons/account/report/account_voucher_print.py @@ -21,7 +21,6 @@ ############################################################################## import time - from report import report_sxw from tools import amount_to_text_en diff --git a/addons/account/report/rml_parse.py b/addons/account/report/rml_parse.py deleted file mode 100644 index 1d3cc629cfa..00000000000 --- a/addons/account/report/rml_parse.py +++ /dev/null @@ -1,150 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2010 Tiny SPRL (). -# -# This program is free software: you can redistribute it and/or modify -# 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. -# -# 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 -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - -from report import report_sxw -import xml.dom.minidom -import time -import osv -import re -import pooler -import sys - - -class rml_parse(report_sxw.rml_parse): - def __init__(self, cr, uid, name, context): - super(rml_parse, self).__init__(cr, uid, name, context=context) - self.localcontext.update({ - 'comma_me': self.comma_me, - 'format_date': self._get_and_change_date_format_for_swiss, - 'strip_name': self._strip_name, - 'explode_name': self._explode_name, - }) - - def comma_me(self,amount): - #print "#" + str(amount) + "#" - if not amount: - amount = 0.0 - if type(amount) is float: - 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) - def _ellipsis(self, string, maxlen=100, ellipsis = '...'): - ellipsis = ellipsis or '' - try: - return string[:maxlen - len(ellipsis) ] + (ellipsis, '')[len(string) < maxlen] - except Exception, e: - return False - def _strip_name(self, name, maxlen=50): - return self._ellipsis(name, maxlen, '...') - - def _get_and_change_date_format_for_swiss (self,date_to_format): - date_formatted='' - if date_to_format: - date_formatted = strptime (date_to_format,'%Y-%m-%d').strftime('%d.%m.%Y') - return date_formatted - - def _explode_name(self,chaine,length): - # We will test if the size is less then account - full_string = '' - if (len(str(chaine)) <= length): - return chaine - # - else: - chaine = unicode(chaine,'utf8').encode('iso-8859-1') - rup = 0 - for carac in chaine: - rup = rup + 1 - if rup == length: - full_string = full_string + '\n' - full_string = full_string + carac - rup = 0 - else: - full_string = full_string + carac - - return full_string - - def makeAscii(self,str): - try: - Stringer = str.encode("utf-8") - except UnicodeDecodeError: - try: - Stringer = str.encode("utf-16") - except UnicodeDecodeError: - print "UTF_16 Error" - Stringer = str - else: - return Stringer - else: - return Stringer - return Stringer - def explode_this(self,chaine,length): - chaine = rstrip(chaine) - ast = list(chaine) - i = length - while i <= len(ast): - ast.insert(i,'\n') - i = i + length - chaine = str("".join(ast)) - return chaine - def repair_string(self,chaine): - ast = list(chaine) - UnicodeAst = [] - _previouslyfound = False - i = 0 - while i < len(ast): - elem = ast[i] - try: - Stringer = elem.encode("utf-8") - except UnicodeDecodeError: - to_reencode = elem + ast[i+1] - print str(to_reencode) - Good_char = to_reencode.decode('utf-8') - UnicodeAst.append(Good_char) - i += i +2 - else: - UnicodeAst.append(elem) - i += i + 1 - - - return "".join(UnicodeAst) - - def ReencodeAscii(self,str): - print sys.stdin.encoding - try: - Stringer = str.decode("ascii") - except UnicodeEncodeError: - print "REENCODING ERROR" - return str.encode("ascii") - except UnicodeDecodeError: - print "DECODING ERROR" - return str.encode("ascii") - - else: - return Stringer - diff --git a/addons/account_voucher/report/rml_parse.py b/addons/account_voucher/report/rml_parse.py deleted file mode 100644 index 1a5d3fa6ec1..00000000000 --- a/addons/account_voucher/report/rml_parse.py +++ /dev/null @@ -1,150 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2010 Tiny SPRL (). -# -# This program is free software: you can redistribute it and/or modify -# 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. -# -# 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 -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - -from report import report_sxw - -from datetime import datetime -import re - -class rml_parse(report_sxw.rml_parse): - def __init__(self, cr, uid, name, context): - super(rml_parse, self).__init__(cr, uid, name, context=None) - self.localcontext.update({ - 'comma_me': self.comma_me, - 'format_date': self._get_and_change_date_format_for_swiss, - 'strip_name': self._strip_name, - 'explode_name': self._explode_name, - }) - - def comma_me(self, amount): - if not amount: - amount = 0.0 - if type(amount) is float: - 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) - - def _ellipsis(self, string, maxlen=100, ellipsis = '...'): - ellipsis = ellipsis or '' - try: - return string[:maxlen - len(ellipsis) ] + (ellipsis, '')[len(string) < maxlen] - except: - return False - - def _strip_name(self, name, maxlen=50): - return self._ellipsis(name, maxlen, '...') - - def _get_and_change_date_format_for_swiss (self, date_to_format): - date_formatted = '' - if date_to_format: - date_formatted = datetime.strptime(date_to_format,'%Y-%m-%d').strftime('%d.%m.%Y') - return date_formatted - - def _explode_name(self, chaine, length): - # We will test if the size is less then account - full_string = '' - if (len(str(chaine)) <= length): - return chaine - # - else: - chaine = unicode(chaine,'utf8').encode('iso-8859-1') - rup = 0 - for carac in chaine: - rup = rup + 1 - if rup == length: - full_string = full_string + '\n' - full_string = full_string + carac - rup = 0 - else: - full_string = full_string + carac - - return full_string - - def makeAscii(self, str): - try: - Stringer = str.encode("utf-8") - except UnicodeDecodeError: - try: - Stringer = str.encode("utf-16") - except UnicodeDecodeError: - Stringer = str - else: - return Stringer - else: - return Stringer - return Stringer - - def explode_this(self, chaine, length): - chaine = rstrip(chaine) - ast = list(chaine) - i = length - while i <= len(ast): - ast.insert(i,'\n') - i = i + length - chaine = str("".join(ast)) - return chaine - - def repair_string(self, chaine): - ast = list(chaine) - UnicodeAst = [] - _previouslyfound = False - i = 0 - while i < len(ast): - elem = ast[i] - try: - Stringer = elem.encode("utf-8") - except UnicodeDecodeError: - to_reencode = elem + ast[i+1] - Good_char = to_reencode.decode('utf-8') - UnicodeAst.append(Good_char) - i += i +2 - else: - UnicodeAst.append(elem) - i += i + 1 - return "".join(UnicodeAst) - - def ReencodeAscii(self, str): - try: - Stringer = str.decode("ascii") - except UnicodeEncodeError: - return str.encode("ascii") - except UnicodeDecodeError: - return str.encode("ascii") - else: - return Stringer - - def _add_header(self, node, header=1): - if header == 2: - rml_head = self.rml_header2 - else: - rml_head = self.rml_header - rml_head = rml_head.replace('',''' [[company.logo]] ''') - return True - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/hr_payroll/report/report_employees_detail.py b/addons/hr_payroll/report/report_employees_detail.py index a71fda1492c..76d723c98ea 100644 --- a/addons/hr_payroll/report/report_employees_detail.py +++ b/addons/hr_payroll/report/report_employees_detail.py @@ -28,9 +28,8 @@ import datetime from report import report_sxw import time import pooler -import rml_parse -class employees_salary_report(rml_parse.rml_parse): +class employees_salary_report(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): super(employees_salary_report, self).__init__(cr, uid, name, context) diff --git a/addons/hr_payroll/report/report_payroll_advice.py b/addons/hr_payroll/report/report_payroll_advice.py index ec79d2a85e1..58484616472 100644 --- a/addons/hr_payroll/report/report_payroll_advice.py +++ b/addons/hr_payroll/report/report_payroll_advice.py @@ -24,7 +24,6 @@ import time from datetime import datetime - from report import report_sxw from tools import amount_to_text_en diff --git a/addons/hr_payroll/report/report_payslip.py b/addons/hr_payroll/report/report_payslip.py index 3d6a4fc550a..bfa6784ac7f 100755 --- a/addons/hr_payroll/report/report_payslip.py +++ b/addons/hr_payroll/report/report_payslip.py @@ -23,7 +23,6 @@ ############################################################################## from datetime import datetime - from report import report_sxw from tools import amount_to_text_en diff --git a/addons/hr_payroll/report/report_year_salary.py b/addons/hr_payroll/report/report_year_salary.py index f084eb2d340..070bb5c8901 100755 --- a/addons/hr_payroll/report/report_year_salary.py +++ b/addons/hr_payroll/report/report_year_salary.py @@ -26,9 +26,8 @@ import datetime from report import report_sxw import time import pooler -import rml_parse -class year_salary_report(rml_parse.rml_parse): +class year_salary_report(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): super(year_salary_report, self).__init__(cr, uid, name, context) diff --git a/addons/hr_payroll/report/rml_parse.py b/addons/hr_payroll/report/rml_parse.py deleted file mode 100755 index 21fbda2f774..00000000000 --- a/addons/hr_payroll/report/rml_parse.py +++ /dev/null @@ -1,154 +0,0 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2009 Tiny SPRL (). All Rights Reserved -# $Id$ -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# 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 -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# -############################################################################## -from time import strptime - -from report import report_sxw -import re -from lxml import etree - - -class rml_parse(report_sxw.rml_parse): - def __init__(self, cr, uid, name, context): - super(rml_parse, self).__init__(cr, uid, name, context=None) - self.localcontext.update({ - 'comma_me': self.comma_me, - 'format_date': self._get_and_change_date_format_for_swiss, - 'strip_name' : self._strip_name, - 'explode_name' : self._explode_name, - }) - - def comma_me(self,amount): - if not amount: - amount = 0.0 - if type(amount) is float : - 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) - - def _ellipsis(self, string, maxlen=100, ellipsis = '...'): - ellipsis = ellipsis or '' - try: - return string[:maxlen - len(ellipsis) ] + (ellipsis, '')[len(string) < maxlen] - except Exception: - return False - - def _strip_name(self, name, maxlen=50): - return self._ellipsis(name, maxlen, '...') - - def _get_and_change_date_format_for_swiss (self,date_to_format): - date_formatted='' - if date_to_format: - date_formatted = strptime(date_to_format,'%Y-%m-%d').strftime('%d.%m.%Y') - return date_formatted - - def _explode_name(self,chaine,length): - # We will test if the size is less then account - full_string = '' - if (len(str(chaine)) <= length): - return chaine - # - else: - chaine = unicode(chaine,'utf8').encode('iso-8859-1') - rup = 0 - for carac in chaine: - rup = rup + 1 - if rup == length: - full_string = full_string + '\n' - full_string = full_string + carac - rup = 0 - else: - full_string = full_string + carac - - return full_string - - def makeAscii(self,str): - try: - Stringer = str.encode("utf-8") - except UnicodeDecodeError: - try: - Stringer = str.encode("utf-16") - except UnicodeDecodeError: - print "UTF_16 Error" - Stringer = str - else: - return Stringer - else: - return Stringer - return Stringer - - def explode_this(self,chaine,length): - chaine = chaine.rstrip() - ast = list(chaine) - i = length - while i <= len(ast): - ast.insert(i,'\n') - i = i + length - chaine = str("".join(ast)) - return chaine - - def repair_string(self,chaine): - ast = list(chaine) - UnicodeAst = [] - i = 0 - while i < len(ast): - elem = ast[i] - try: - Stringer = elem.encode("utf-8") - except UnicodeDecodeError: - to_reencode = elem + ast[i+1] - print str(to_reencode) - Good_char = to_reencode.decode('utf-8') - UnicodeAst.append(Good_char) - i += i +2 - else: - UnicodeAst.append(elem) - i += i + 1 - return "".join(UnicodeAst) - - def _add_header(self, node, header='external'): - if header=='internal': - rml_head = self.rml_header2 - elif header=='internal landscape': - rml_head = self.rml_header3 - else: - rml_head = self.rml_header - rml_head = rml_head.replace('',''' [[company.logo]] ''') - rml_dom = node - head_dom = etree.XML(rml_head) - for tag in head_dom: - found = rml_dom.find('.//'+tag.tag) - if found is not None and len(found): - if tag.get('position'): - found.append(tag) - else : - found.getparent().replace(found,tag) - return True - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file From 8bd4923b9b7ba41c624ed60ec69a78d053e4f88f Mon Sep 17 00:00:00 2001 From: apa-tiny Date: Tue, 26 Oct 2010 15:18:40 +0530 Subject: [PATCH 02/13] [IMP]:account:added strip_name function in general ledger report. bzr revid: apa@tinyerp.com-20101026094840-k7eoajbkipno8k1u --- addons/account/report/account_general_ledger.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/addons/account/report/account_general_ledger.py b/addons/account/report/account_general_ledger.py index e498fe1345f..e1de4d2d522 100644 --- a/addons/account/report/account_general_ledger.py +++ b/addons/account/report/account_general_ledger.py @@ -86,9 +86,20 @@ class general_ledger(report_sxw.rml_parse, common_report_header): 'get_start_date':self._get_start_date, 'get_end_date':self._get_end_date, 'get_target_move': self._get_target_move, + 'strip_name': self._strip_name, }) self.context = context + def _ellipsis(self, orig_str, maxlen=100, ellipsis='...'): + maxlen = maxlen - len(ellipsis) + if maxlen <= 0: + maxlen = 1 + new_str = orig_str[:maxlen] + return new_str + + def _strip_name(self, name, maxlen=50): + return self._ellipsis(name, maxlen, ' ...') + def _sum_currency_amount_account(self, account): self.cr.execute('SELECT sum(l.amount_currency) AS tot_currency \ FROM account_move_line l \ From 27425914aadb5a761a0c5d562dac273690dceada Mon Sep 17 00:00:00 2001 From: apa-tiny Date: Mon, 1 Nov 2010 15:46:02 +0530 Subject: [PATCH 04/13] [IMP]:account:improved general leder report with inital balance bzr revid: apa@tinyerp.com-20101101101602-8ynmiffnke3jok63 --- addons/account/report/account_general_ledger.rml | 2 +- addons/account/report/account_general_ledger_landscape.rml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/account/report/account_general_ledger.rml b/addons/account/report/account_general_ledger.rml index 479d1b6c65d..0cecffa7384 100644 --- a/addons/account/report/account_general_ledger.rml +++ b/addons/account/report/account_general_ledger.rml @@ -334,7 +334,7 @@ [[ formatLang(line['debit']) ]] [[ formatLang(line['credit']) ]] [[ formatLang(line['progress']) ]] [[ company.currency_id.symbol ]] - [[ line['amount_currency']==True or removeParentNode('font') ]] [[ formatLang(line['amount_currency'])]] [[ line['currency_code'] or '']] + [[ (line.has_key('currency_id') and line['currency_id']==None or line['amount_currency']==None) and removeParentNode('font') ]] [[ formatLang(line['amount_currency'])]] [[ line['currency_code'] or '']] diff --git a/addons/account/report/account_general_ledger_landscape.rml b/addons/account/report/account_general_ledger_landscape.rml index 41fc999eaad..46f573abbf0 100644 --- a/addons/account/report/account_general_ledger_landscape.rml +++ b/addons/account/report/account_general_ledger_landscape.rml @@ -295,7 +295,7 @@ [[ formatLang(line['debit'], digits=get_digits(dp='Account')) ]] [[ formatLang(line['credit'], digits=get_digits(dp='Account')) ]] [[ formatLang(line['progress'], digits=get_digits(dp='Account')) ]] [[ company.currency_id.symbol ]] - [[ line['amount_currency']==True or removeParentNode('font') ]] [[ formatLang(line['amount_currency'])]] [[ line['currency_code'] or '']] + [[ (line.has_key('currency_id') and line['currency_id']==None or line['amount_currency']==None) and removeParentNode('font') ]] [[ formatLang(line['amount_currency'])]] [[ line['currency_code'] or '']] From 445f6ad0d2845cc80a8dc6d7f1c828d99aaeaf8e Mon Sep 17 00:00:00 2001 From: apa-tiny Date: Mon, 1 Nov 2010 15:55:04 +0530 Subject: [PATCH 05/13] [IMP]:account:improved general leder report for big values bzr revid: apa@tinyerp.com-20101101102504-phfn0sha6s3aj5vx --- addons/account/report/account_general_ledger_landscape.rml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/account/report/account_general_ledger_landscape.rml b/addons/account/report/account_general_ledger_landscape.rml index 46f573abbf0..b965a9c8406 100644 --- a/addons/account/report/account_general_ledger_landscape.rml +++ b/addons/account/report/account_general_ledger_landscape.rml @@ -301,7 +301,7 @@ - [[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]] + [[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]] Date JNRL @@ -320,10 +320,10 @@ [[ repeatIn(get_children_accounts(a), 'o') ]] - [[data['form']['amount_currency'] == False or removeParentNode('blockTable')]] + [[data['form']['amount_currency'] == False or removeParentNode('blockTable')]] - + [[ '..'*(o.level-1) ]][[ o.code ]] [[ o.name ]] From 6adf0753c51383115f583b15c8bcbe1c45943343 Mon Sep 17 00:00:00 2001 From: apa-tiny Date: Mon, 1 Nov 2010 16:00:43 +0530 Subject: [PATCH 06/13] [IMP]:account:improved account balance bzr revid: apa@tinyerp.com-20101101103043-ehgb667zya266t9w --- addons/account/report/account_balance.rml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/account/report/account_balance.rml b/addons/account/report/account_balance.rml index 9ac1a2f0c87..533999ae5ab 100644 --- a/addons/account/report/account_balance.rml +++ b/addons/account/report/account_balance.rml @@ -148,11 +148,11 @@ - + - + @@ -189,7 +189,7 @@ - + From e6d1eb9e4d85c5e047f21ad94f807f15144f9c91 Mon Sep 17 00:00:00 2001 From: apa-tiny Date: Mon, 1 Nov 2010 16:03:17 +0530 Subject: [PATCH 07/13] [IMP]:account:improved bzr revid: apa@tinyerp.com-20101101103317-6mbay0gketm01jr4 --- addons/account/report/account_profit_loss.rml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/report/account_profit_loss.rml b/addons/account/report/account_profit_loss.rml index c371ab4c638..e044c32e139 100644 --- a/addons/account/report/account_profit_loss.rml +++ b/addons/account/report/account_profit_loss.rml @@ -238,7 +238,7 @@ - Total:([[ get_currency(data) ]]) + Total: [[ formatLang(abs(sum_dr())) ]] [[ company.currency_id.symbol ]] From 64ec8f4ca78e68759d04c6eb9d9cd263d672df88 Mon Sep 17 00:00:00 2001 From: apa-tiny Date: Mon, 1 Nov 2010 16:07:51 +0530 Subject: [PATCH 08/13] [IMP]:account:improved bzr revid: apa@tinyerp.com-20101101103751-bxkcr8bertjipo3j --- addons/account/report/account_balance_sheet.rml | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/addons/account/report/account_balance_sheet.rml b/addons/account/report/account_balance_sheet.rml index 076de7bdcd4..53dbc453e95 100644 --- a/addons/account/report/account_balance_sheet.rml +++ b/addons/account/report/account_balance_sheet.rml @@ -35,19 +35,7 @@ - - - - - - - - - - - - - + @@ -230,7 +218,7 @@ - + Balance: From 6295c236df452724f1b809474c769f0512a4807d Mon Sep 17 00:00:00 2001 From: apa-tiny Date: Mon, 1 Nov 2010 16:36:11 +0530 Subject: [PATCH 09/13] [IMP]:account:improved invoices report for big columns bzr revid: apa@tinyerp.com-20101101110611-imtzgkfgeuuxo6dw --- .../account/report/account_print_invoice.rml | 10 +++---- .../report/report_account_invoice_layout.rml | 29 +++++++------------ .../report/special_message_invoice.rml | 29 +++++++------------ 3 files changed, 25 insertions(+), 43 deletions(-) diff --git a/addons/account/report/account_print_invoice.rml b/addons/account/report/account_print_invoice.rml index 87f3bb770ba..c6057627b32 100644 --- a/addons/account/report/account_print_invoice.rml +++ b/addons/account/report/account_print_invoice.rml @@ -194,7 +194,7 @@ - + Description @@ -218,7 +218,7 @@
[[ repeatIn(o.invoice_line,'l') ]] - + [[ l.name ]] @@ -271,7 +271,7 @@
- + @@ -315,7 +315,7 @@ - + Tax [[ o.tax_line==[] and removeParentNode('blockTable') ]] @@ -335,7 +335,7 @@
[[ repeatIn(o.tax_line,'t') ]] - + [[ t.name ]] diff --git a/addons/account_invoice_layout/report/report_account_invoice_layout.rml b/addons/account_invoice_layout/report/report_account_invoice_layout.rml index df7c25f3de8..1eac32853e5 100644 --- a/addons/account_invoice_layout/report/report_account_invoice_layout.rml +++ b/addons/account_invoice_layout/report/report_account_invoice_layout.rml @@ -60,7 +60,6 @@ - @@ -245,7 +244,7 @@ - + Description / Taxes @@ -266,7 +265,7 @@
[[ repeatIn(invoice_lines(o), 'a') ]] - + [[ a['type']=='text' and removeParentNode('blockTable')]] @@ -275,10 +274,7 @@ [[ ((a['type']=='title' or a['type']=='subtotal') and ( setTag('para','para',{'fontName':'Helvetica-bold'}))) or removeParentNode('font') ]][[ a['name'] ]] [[ a['type']=='article' and ('/ (' + a['tax_types'] + ')' ) ]] - [[ (a['type']=='subtotal' and ( setTag('para','para',{'fontName':'Helvetica-bold'}))) or removeParentNode('font') ]][[ a['quantity'] ]] - - - [[ a['uos'] ]] + [[ (a['type']=='subtotal' and ( setTag('para','para',{'fontName':'Helvetica-bold'}))) or removeParentNode('font') ]][[ a['quantity'] ]] [[ a['uos'] ]] [[ (a['type']=='subtotal' and ( setTag('para','para',{'fontName':'Helvetica-bold'}))) or removeParentNode('font') ]][[ a['price_unit'] ]] @@ -322,11 +318,6 @@ - - - - - @@ -344,8 +335,8 @@ - [[ a['type']!='break' and removeParentNode('pageBreak')]] - + [[ a['type']!='break' and removeParentNode('pageBreak')]] + Description / Taxes [[ a['type']!='break' and removeParentNode('blockTable')]] @@ -365,7 +356,7 @@
- + @@ -380,7 +371,7 @@ - + @@ -395,7 +386,7 @@ - + @@ -416,7 +407,7 @@ - + Tax [[ o.tax_line==[] and removeParentNode('blockTable') ]] @@ -436,7 +427,7 @@
[[ repeatIn(o.tax_line,'t') ]] - + [[ t.name ]] diff --git a/addons/account_invoice_layout/report/special_message_invoice.rml b/addons/account_invoice_layout/report/special_message_invoice.rml index 2925b3526b8..282dce2d988 100644 --- a/addons/account_invoice_layout/report/special_message_invoice.rml +++ b/addons/account_invoice_layout/report/special_message_invoice.rml @@ -60,7 +60,6 @@ - @@ -249,7 +248,7 @@ - + Description / Taxes @@ -270,7 +269,7 @@
[[ repeatIn(invoice_lines(o), 'a') ]] - + [[ a['type']=='text' and removeParentNode('blockTable')]] @@ -279,10 +278,7 @@ [[ ((a['type']=='title' or a['type']=='subtotal') and ( setTag('para','para',{'fontName':'Helvetica-bold'}))) or removeParentNode('font') ]][[ a['name'] ]] [[ a['type']=='article' and ('/ (' + a['tax_types'] +' )' ) ]] - [[ (a['type']=='subtotal' and ( setTag('para','para',{'fontName':'Helvetica-bold'}))) or removeParentNode('font') ]][[ a['quantity'] ]] - - - [[ a['uos'] ]] + [[ (a['type']=='subtotal' and ( setTag('para','para',{'fontName':'Helvetica-bold'}))) or removeParentNode('font') ]][[ a['quantity'] ]] [[ a['uos'] ]] [[ (a['type']=='subtotal' and ( setTag('para','para',{'fontName':'Helvetica-bold'}))) or removeParentNode('font') ]][[ a['price_unit'] ]] @@ -326,11 +322,6 @@ - - - - - @@ -348,8 +339,8 @@ - [[ a['type']!='break' and removeParentNode('pageBreak')]] - + [[ a['type']!='break' and removeParentNode('pageBreak')]] + Description / Taxes [[ a['type']!='break' and removeParentNode('blockTable')]] @@ -369,7 +360,7 @@
- + @@ -384,7 +375,7 @@ - + @@ -399,7 +390,7 @@ - + @@ -420,7 +411,7 @@ - + Tax [[ o.tax_line==[] and removeParentNode('blockTable') ]] @@ -440,7 +431,7 @@
[[ repeatIn(o.tax_line,'t') ]] - + [[ t.name ]] From 7da798be59aa4f7d47e61f506b74ac40db7f5679 Mon Sep 17 00:00:00 2001 From: apa-tiny Date: Mon, 1 Nov 2010 16:38:19 +0530 Subject: [PATCH 10/13] [IMP]:account:improved bzr revid: apa@tinyerp.com-20101101110819-pgogbadbbgixo4hl --- addons/account/report/account_partner_balance.rml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/report/account_partner_balance.rml b/addons/account/report/account_partner_balance.rml index 19eef489507..780f285a608 100644 --- a/addons/account/report/account_partner_balance.rml +++ b/addons/account/report/account_partner_balance.rml @@ -227,7 +227,7 @@ - + Code (Account/Partner) Name From 05ece80821a8c52a979e6831a5a33c522960b37d Mon Sep 17 00:00:00 2001 From: apa-tiny Date: Mon, 1 Nov 2010 16:51:21 +0530 Subject: [PATCH 11/13] [IMP]:account:improved bzr revid: apa@tinyerp.com-20101101112121-8mllkqk8qy1gmpgd --- addons/account/report/account_partner_ledger.rml | 12 ++++++------ .../account/report/account_partner_ledger_other.rml | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/addons/account/report/account_partner_ledger.rml b/addons/account/report/account_partner_ledger.rml index 139d9bb16cd..ffd12e749bb 100644 --- a/addons/account/report/account_partner_ledger.rml +++ b/addons/account/report/account_partner_ledger.rml @@ -277,7 +277,7 @@ - [[ display_currency(data) == False or removeParentNode('blockTable') ]] + [[ display_currency(data) == False or removeParentNode('blockTable') ]] Date @@ -311,20 +311,20 @@ - [[ display_currency(data) == False or removeParentNode('blockTable') ]] + [[ display_currency(data) == False or removeParentNode('blockTable') ]] [[ p.ref ]] - [[ p.name ]] - [[ formatLang((sum_debit_partner(p))) ]] + [[ formatLang((sum_debit_partner(p))) ]] - [[ formatLang((sum_credit_partner(p))) ]] + [[ formatLang((sum_credit_partner(p))) ]] - [[ formatLang((sum_debit_partner(p) - sum_credit_partner(p))) ]] [[ company.currency_id.symbol ]] + [[ formatLang((sum_debit_partner(p) - sum_credit_partner(p))) ]] [[ company.currency_id.symbol ]] @@ -347,7 +347,7 @@
[[ repeatIn(lines(p), 'line') ]] - [[ display_currency(data) == False or removeParentNode('blockTable') ]] + [[ display_currency(data) == False or removeParentNode('blockTable') ]] [[ formatLang(line['date'],date=True) ]] diff --git a/addons/account/report/account_partner_ledger_other.rml b/addons/account/report/account_partner_ledger_other.rml index 644077eec84..1cfbc01ae22 100644 --- a/addons/account/report/account_partner_ledger_other.rml +++ b/addons/account/report/account_partner_ledger_other.rml @@ -432,7 +432,7 @@ - [[ display_currency(data) == False or removeParentNode('blockTable') ]] + [[ display_currency(data) == False or removeParentNode('blockTable') ]] Date @@ -462,7 +462,7 @@
[[ repeatIn(objects, 'p') ]] [[ setLang(p.lang) ]] - [[ display_currency(data) == False or removeParentNode('blockTable') ]] + [[ display_currency(data) == False or removeParentNode('blockTable') ]] @@ -495,7 +495,7 @@
[[ repeatIn(lines(p), 'line') ]] - [[ display_currency(data) == False or removeParentNode('blockTable') ]] + [[ display_currency(data) == False or removeParentNode('blockTable') ]] [[ formatLang(line['date'],date=True) ]] From 944492be6667c3077dc02ff49ec5849835b1aac5 Mon Sep 17 00:00:00 2001 From: apa-tiny Date: Mon, 1 Nov 2010 16:59:29 +0530 Subject: [PATCH 12/13] [IMP]:purchase:purchase order bzr revid: apa@tinyerp.com-20101101112929-etvdgcbltnhu0q55 --- addons/purchase/report/order.rml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/purchase/report/order.rml b/addons/purchase/report/order.rml index 60ee35b92bb..0ca1a8d6878 100644 --- a/addons/purchase/report/order.rml +++ b/addons/purchase/report/order.rml @@ -226,7 +226,7 @@ - + Description @@ -250,7 +250,7 @@
[[repeatIn(o.order_line,'line')]] - + [[ line.name ]] @@ -265,7 +265,7 @@ [[ formatLang(line.product_qty ) ]] [[ line.product_uom.name ]] - [[ formatLang(line.price_unit, digits=get_digits(dp='Purchase Price') ) ]] + [[ formatLang(line.price_unit, digits=get_digits(dp='Purchase Price') ) ]] [[ formatLang(line.price_subtotal, digits=get_digits(dp='Purchase Price') ) ]] [[ o.pricelist_id.currency_id.symbol ]] @@ -303,7 +303,7 @@
- + From d6ee6c88504af04b6cdf5ca2af00eaf4bb276a6a Mon Sep 17 00:00:00 2001 From: apa-tiny Date: Mon, 1 Nov 2010 17:06:36 +0530 Subject: [PATCH 13/13] [IMP]:account:improved central journal bzr revid: apa@tinyerp.com-20101101113636-a3swlrlzlss2s1to --- addons/account/report/account_central_journal.rml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/addons/account/report/account_central_journal.rml b/addons/account/report/account_central_journal.rml index 28cb68fcce3..960e2786692 100644 --- a/addons/account/report/account_central_journal.rml +++ b/addons/account/report/account_central_journal.rml @@ -274,7 +274,7 @@ - [[ display_currency(data) == False or removeParentNode('blockTable') ]] + [[ display_currency(data) == False or removeParentNode('blockTable') ]] A/C No. Account Name @@ -283,7 +283,7 @@ Balance - [[ display_currency(data) or removeParentNode('blockTable') ]] + [[ display_currency(data) or removeParentNode('blockTable') ]] A/C No. Account Name @@ -293,7 +293,7 @@ Currency - [[ display_currency(data) == False or removeParentNode('blockTable') ]] + [[ display_currency(data) == False or removeParentNode('blockTable') ]] Total: @@ -302,7 +302,7 @@ [[ formatLang( sum_credit(o.period_id.id, o.journal_id.id)-sum_debit(o.period_id.id, o.journal_id.id) ) ]] [[ company.currency_id.symbol ]] - [[ display_currency(data) or removeParentNode('blockTable') ]] + [[ display_currency(data) or removeParentNode('blockTable') ]] Total: @@ -314,7 +314,7 @@
[[ repeatIn(lines(o.period_id.id,o.journal_id.id),'line') ]] - [[ display_currency(data) == False or removeParentNode('blockTable') ]] + [[ display_currency(data) == False or removeParentNode('blockTable') ]] [[ line['code'] ]] [[ line['name'] ]] @@ -323,7 +323,7 @@ [[ formatLang(line['credit']-line['debit']) ]] [[ company.currency_id.symbol ]] - [[ display_currency(data) or removeParentNode('blockTable') ]] + [[ display_currency(data) or removeParentNode('blockTable') ]] [[ line['code'] ]] [[ line['name'] ]]