From ad91862c11b1361e7a0aeaaca180cf222f2a2a09 Mon Sep 17 00:00:00 2001 From: "nicolas.bessi@camptocamp.com" <> Date: Wed, 19 Jan 2011 15:50:32 +0100 Subject: [PATCH 01/24] [FIX] bug 704870 webkit_locals bzr revid: nicolas.bessi@camptocamp.com-20110119145032-61kf5gqi281x0br7 --- addons/report_webkit/webkit_report.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/addons/report_webkit/webkit_report.py b/addons/report_webkit/webkit_report.py index 2944b768643..47d3e58482d 100644 --- a/addons/report_webkit/webkit_report.py +++ b/addons/report_webkit/webkit_report.py @@ -123,17 +123,17 @@ class WebKitParser(report_sxw): command.append("--footer-html '%s'"%(foot_file.name)) if webkit_header.margin_top : - command.append('--margin-top %s'%(webkit_header.margin_top)) + command.append('--margin-top %s'%(str(webkit_header.margin_top).replace(',', '.'))) if webkit_header.margin_bottom : - command.append('--margin-bottom %s'%(webkit_header.margin_bottom)) + command.append('--margin-bottom %s'%(str(webkit_header.margin_bottom).replace(',', '.'))) if webkit_header.margin_left : - command.append('--margin-left %s'%(webkit_header.margin_left)) + command.append('--margin-left %s'%(str(webkit_header.margin_left).replace(',', '.'))) if webkit_header.margin_right : - command.append('--margin-right %s'%(webkit_header.margin_right)) + command.append('--margin-right %s'%(str(webkit_header.margin_right).replace(',', '.'))) if webkit_header.orientation : - command.append("--orientation '%s'"%(webkit_header.orientation)) + command.append("--orientation '%s'"%(str(webkit_header.orientation).replace(',', '.'))) if webkit_header.format : - command.append(" --page-size '%s'"%(webkit_header.format)) + command.append(" --page-size '%s'"%(str(webkit_header.format).replace(',', '.'))) count = 0 for html in html_list : html_file = file(os.path.join(tmp_dir, str(time.time()) + str(count) +'.body.html'), 'w') From 4832c55df9d08ae11f0e97ae9104d14ef4d54d09 Mon Sep 17 00:00:00 2001 From: Bogdan Stanciu Date: Wed, 26 Jan 2011 13:57:55 +0100 Subject: [PATCH 02/24] [FIX] COA correction (account_account_type data was missing) for BS and P&L reporting lp bug: https://launchpad.net/bugs/707314 fixed bzr revid: bogdanovidiu.stanciu@gmail.com-20110126125755-urjp29cl0yibs5ur --- addons/l10n_ch/sterchi_chart/account.xml | 30 ++++++++++++++++++++---- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/addons/l10n_ch/sterchi_chart/account.xml b/addons/l10n_ch/sterchi_chart/account.xml index dbc99227c42..8c907653b4a 100644 --- a/addons/l10n_ch/sterchi_chart/account.xml +++ b/addons/l10n_ch/sterchi_chart/account.xml @@ -10,26 +10,31 @@ Bilan : Liquidites et titres cash balance + asset Bilan : Actif de regularisation adjusting_asset balance + asset Bilan : Capitaux propres equity balance + liability PP : Chiffre d'affaires income none + income Bilan : Passifs de regularisation adj_liability balance + liability Autre : Cloture @@ -40,103 +45,123 @@ PP : Amortissement depreciation none + expense PP : Resultat financier financial_result none + income Bilan : Immobilisations financieres financial_asset balance + asset Bilan : Immo corporelles immobilieres building_asset balance + asset Bilan : Actifs hors exploitation non_ope_asset balance + asset PP : Autres charges d'exploitation other_ope_expense none + expense Bilan : Dettes hors exploitation non_ope_debts balance + liability Bilan : Immo corporelles mobilieres fixed_asset balance + asset Bilan : Immo incorporelles intangible_asset balance + asset Bilan : Stocks inventory balance + asset Bilan : Dettes à LT lt_liability balance + liability PP : Resultat activites annexes non_oper_result none + income Bilan : Autres creanciers à CT other_payable balance + liability Bilan : Autres créances other_receivable balance + asset PP : Charge de personnel personnal_exp none + expense Bilan : Provisions et reserves provision_reserve balance + liability PP : Achat de marchandise purchase none + expense Bilan : Resultat reporte report_result balance + liability Bilan : Debiteurs receivable True unreconciled + asset Bilan : Fournisseurs payable True unreconciled + liability Autre : Consolidation @@ -148,11 +173,6 @@ other none - - Autre : Closed - closed - none - Plan comptable 0 From 3d618f2de49325f7b83c65493f6ae0619d3dc90f Mon Sep 17 00:00:00 2001 From: "nicolas.bessi@camptocamp.com" <> Date: Fri, 28 Jan 2011 09:48:01 +0100 Subject: [PATCH 03/24] [FIX] better coding standard bzr revid: nicolas.bessi@camptocamp.com-20110128084801-a2w9hvy2ipl1wzis --- addons/l10n_ch/account_move_line.py | 2 +- addons/l10n_ch/account_wizard.py | 3 ++- addons/l10n_ch/company.py | 9 ++++----- addons/l10n_ch/invoice.py | 1 - addons/l10n_ch/report/report_webkit_html.py | 19 ++++++++++--------- .../report/report_webkit_html_view.xml | 6 +++--- addons/l10n_ch/wizard/create_dta.py | 2 +- 7 files changed, 21 insertions(+), 21 deletions(-) diff --git a/addons/l10n_ch/account_move_line.py b/addons/l10n_ch/account_move_line.py index da9aab741a6..9cf2ea26b6b 100644 --- a/addons/l10n_ch/account_move_line.py +++ b/addons/l10n_ch/account_move_line.py @@ -60,7 +60,7 @@ class AccountMoveLine(osv.osv): _inherit = 'account.move.line' - def line2bank(self, cr, uid, ids, payment_type='manual', context=None): + def __line2bank(self, cr, uid, ids, payment_type='manual', context=None): """add a link to account.move.line in order to link supplier invoice line and bank. The original link was defined in account_payment""" diff --git a/addons/l10n_ch/account_wizard.py b/addons/l10n_ch/account_wizard.py index b2e1ab00924..08c969dd654 100644 --- a/addons/l10n_ch/account_wizard.py +++ b/addons/l10n_ch/account_wizard.py @@ -21,6 +21,7 @@ import tools from osv import osv import addons +import os class WizardMultiChartsAccounts(osv.osv_memory): @@ -35,7 +36,7 @@ class WizardMultiChartsAccounts(osv.osv_memory): def execute(self, cr, uid, ids, context=None): """Override of code in order to be able to link journal with account in XML""" res = super(WizardMultiChartsAccounts, self).execute(cr, uid, ids, context) - path = addons.get_module_resource('l10n_ch/sterchi_chart/account_journal_rel.xml') + path = addons.get_module_resource(os.path.join('l10n_ch','sterchi_chart','account_journal_rel.xml')) tools.convert_xml_import(cr, 'l10n_ch', path, idref=None, mode='init', noupdate=True, report=None) return res diff --git a/addons/l10n_ch/company.py b/addons/l10n_ch/company.py index da8f7b53cc6..20f6b6168ec 100644 --- a/addons/l10n_ch/company.py +++ b/addons/l10n_ch/company.py @@ -27,13 +27,12 @@ class res_company(osv.osv): _inherit = "res.company" _columns = { - ### horiz. delta in mm 1.2 will print the bvz 1.2mm lefter 'bvr_delta_horz': fields.float('BVR Horz. Delta (mm)', - help='horiz. delta in mm 1.2 will print the bvz 1.2mm lefter'), - ### vert. delta in mm 1.2 will print the bvz 1.2mm lefter + help='horiz. delta in mm 1.2 will print the bvr 1.2mm lefter, negative value is possible'), + 'bvr_delta_vert': fields.float('BVR Vert. Delta (mm)', - help='vert. delta in mm 1.2 will print the bvz 1.2mm lefter'), - ### print bvr background image for standard paper or e-mail + help='vert. delta in mm 1.2 will print the bvr 1.2mm lower, negative value is possible'), + 'bvr_background': fields.boolean('Insert BVR background ?'), 'bvr_only': fields.boolean('Separated BVR only ?', diff --git a/addons/l10n_ch/invoice.py b/addons/l10n_ch/invoice.py index aa59a742722..07c62d43d51 100644 --- a/addons/l10n_ch/invoice.py +++ b/addons/l10n_ch/invoice.py @@ -191,7 +191,6 @@ class account_tax_code(osv.osv): _name = 'account.tax.code' _inherit = "account.tax.code" _columns = { - ### The case code of the tax code 'code': fields.char('Case Code', size=512), } diff --git a/addons/l10n_ch/report/report_webkit_html.py b/addons/l10n_ch/report/report_webkit_html.py index 449bcb15051..5e0a1f22995 100644 --- a/addons/l10n_ch/report/report_webkit_html.py +++ b/addons/l10n_ch/report/report_webkit_html.py @@ -33,6 +33,7 @@ import addons import pooler from tools.config import config from mako.template import Template +from tools.translate import _ class l10n_ch_report_webkit_html(report_sxw.rml_parse): @@ -60,12 +61,12 @@ class l10n_ch_report_webkit_html(report_sxw.rml_parse): def police_absolute_path(self, inner_path) : """Will get the ocrb police absolute path""" - path = addons.get_module_resource('l10n_ch/report/'+inner_path) + path = addons.get_module_resource(os.path.join('l10n_ch','report',inner_path)) return path def bvr_absolute_path(self) : """Will get the ocrb police absolute path""" - path = addons.get_module_resource('l10n_ch/report/bvr1.jpg') + path = addons.get_module_resource(os.path.join('l10n_ch','report','bvr1.jpg')) return path def headheight(self): @@ -113,18 +114,18 @@ class l10n_ch_report_webkit_html(report_sxw.rml_parse): ids = [x.id for x in invoices] for invoice in invoice_obj.browse(cursor, self.uid, ids): if not invoice.partner_bank_id: - raise wizard.except_wizard('UserError', - 'No bank specified on invoice:\n' + \ + raise wizard.except_wizard(_('UserError'), + _('No bank specified on invoice:\n' + \ invoice_obj.name_get(cursor, self.uid, [invoice.id], - context={})[0][1]) + context={})[0][1])) if not self._compile_check_bvr.match( invoice.partner_bank_id.bvr_number or ''): - raise wizard.except_wizard('UserError', - "Your bank BVR number should be of the form 0X-XXX-X! " + + raise wizard.except_wizard(_('UserError'), + _("Your bank BVR number should be of the form 0X-XXX-X! " + 'Please check your company ' + 'information for the invoice:\n' + invoice_obj.name_get(cursor, self.uid, [invoice.id], - context={})[0][1]) + context={})[0][1])) if invoice.partner_bank_id.bvr_adherent_num \ and not self._compile_check_bvr_add_num.match( invoice.partner_bank_id.bvr_adherent_num): @@ -198,7 +199,7 @@ class BVRWebKitParser(webkit_report.WebKitParser): #default_filters=['unicode', 'entity'] can be used to set global filter body_mako_tpl = Template(parse_template ,input_encoding='utf-8') #BVR specific - bvr_path = addons.get_module_resource('l10n_ch/report/bvr.mako') + bvr_path = addons.get_module_resource(os.path.join('l10n_ch','report','bvr.mako')) body_bvr_tpl = Template(file(bvr_path).read(), input_encoding='utf-8') helper = report_helper.WebKitHelper(cursor, uid, report_xml.id, context) diff --git a/addons/l10n_ch/report/report_webkit_html_view.xml b/addons/l10n_ch/report/report_webkit_html_view.xml index 8c66b1038c8..c03db709162 100644 --- a/addons/l10n_ch/report/report_webkit_html_view.xml +++ b/addons/l10n_ch/report/report_webkit_html_view.xml @@ -2,8 +2,8 @@ - - + Portrait + A4