From a80926d9c901bc51aa9bdbdaf5876a5aa88d38d4 Mon Sep 17 00:00:00 2001 From: Jacques-Etienne Baudoux Date: Sun, 3 Nov 2013 13:55:27 +0100 Subject: [PATCH 1/2] [FIX] imports --- account_financial_report_webkit/report/open_invoices.py | 2 +- account_financial_report_webkit/report/print_journal.py | 6 +++--- .../report/webkit_parser_header_fix.py | 4 ++-- account_financial_report_webkit/wizard/print_journal.py | 5 ++--- .../wizard/trial_balance_wizard.py | 4 ++-- 5 files changed, 10 insertions(+), 11 deletions(-) diff --git a/account_financial_report_webkit/report/open_invoices.py b/account_financial_report_webkit/report/open_invoices.py index c49c82f4..237f9e4f 100644 --- a/account_financial_report_webkit/report/open_invoices.py +++ b/account_financial_report_webkit/report/open_invoices.py @@ -20,7 +20,6 @@ ############################################################################## from collections import defaultdict -from report import report_sxw from datetime import datetime from itertools import groupby from operator import itemgetter @@ -30,6 +29,7 @@ from mako.template import Template import openerp.addons from openerp import pooler from openerp.osv import osv +from openerp.report import report_sxw from openerp.tools.translate import _ from openerp.addons.report_webkit import report_helper from .common_partner_reports import CommonPartnersReportHeaderWebkit diff --git a/account_financial_report_webkit/report/print_journal.py b/account_financial_report_webkit/report/print_journal.py index 71d386de..7d14059e 100644 --- a/account_financial_report_webkit/report/print_journal.py +++ b/account_financial_report_webkit/report/print_journal.py @@ -22,9 +22,9 @@ # ############################################################################## -from report import report_sxw -from tools.translate import _ -import pooler +from openerp.report import report_sxw +from openerp.tools.translate import _ +from openerp import pooler from datetime import datetime from common_reports import CommonReportHeaderWebkit diff --git a/account_financial_report_webkit/report/webkit_parser_header_fix.py b/account_financial_report_webkit/report/webkit_parser_header_fix.py index 7240604a..29d458ba 100644 --- a/account_financial_report_webkit/report/webkit_parser_header_fix.py +++ b/account_financial_report_webkit/report/webkit_parser_header_fix.py @@ -31,8 +31,6 @@ import os import subprocess import tempfile import time -import pooler -import tools import logging @@ -40,6 +38,8 @@ from mako import exceptions from openerp.osv.osv import except_osv from openerp.tools.translate import _ from openerp import addons +from openerp import pooler +from openerp import tools from openerp.addons.report_webkit import webkit_report from openerp.addons.report_webkit.webkit_report import mako_template from openerp.addons.report_webkit.report_helper import WebKitHelper diff --git a/account_financial_report_webkit/wizard/print_journal.py b/account_financial_report_webkit/wizard/print_journal.py index 191d1daf..dfb514c5 100644 --- a/account_financial_report_webkit/wizard/print_journal.py +++ b/account_financial_report_webkit/wizard/print_journal.py @@ -22,13 +22,12 @@ # ############################################################################## -from osv import osv -from osv import fields +from openerp.osv import fields, orm import time from lxml import etree -class AccountReportPrintJournalWizard(osv.osv_memory): +class AccountReportPrintJournalWizard(orm.TransientModel): """Will launch print journal report and pass requiered args""" _inherit = "account.common.account.report" diff --git a/account_financial_report_webkit/wizard/trial_balance_wizard.py b/account_financial_report_webkit/wizard/trial_balance_wizard.py index 25e14359..6981a947 100644 --- a/account_financial_report_webkit/wizard/trial_balance_wizard.py +++ b/account_financial_report_webkit/wizard/trial_balance_wizard.py @@ -19,10 +19,10 @@ # ############################################################################## -from osv import osv +from openerp.osv import orm -class AccountTrialBalanceWizard(osv.osv_memory): +class AccountTrialBalanceWizard(orm.TransientModel): """Will launch trial balance report and pass required args""" _inherit = "account.common.balance.report" From 09c73a6177a5ea732d49fde4d747a572afae5d21 Mon Sep 17 00:00:00 2001 From: Jacques-Etienne Baudoux Date: Thu, 14 Nov 2013 10:13:13 +0100 Subject: [PATCH 2/2] [FIX]account_financial_report_webkit: Open Invoices Report: fix wrong xmlid in report definition, removed useless import of addons in template, hasattr cannot be used on browse object - replaced by 'field' in browse_object --- account_financial_report_webkit/report/report.xml | 2 +- .../report/templates/account_report_open_invoices.mako | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/account_financial_report_webkit/report/report.xml b/account_financial_report_webkit/report/report.xml index f617d0bd..6fa33a25 100644 --- a/account_financial_report_webkit/report/report.xml +++ b/account_financial_report_webkit/report/report.xml @@ -124,7 +124,7 @@ account_financial_report_webkit/report/templates/account_report_print_journal.mako account_financial_report_webkit/report/templates/account_report_print_journal.mako - + account_report_print_journal_webkit diff --git a/account_financial_report_webkit/report/templates/account_report_open_invoices.mako b/account_financial_report_webkit/report/templates/account_report_open_invoices.mako index 02dc6952..29a6fd36 100644 --- a/account_financial_report_webkit/report/templates/account_report_open_invoices.mako +++ b/account_financial_report_webkit/report/templates/account_report_open_invoices.mako @@ -21,7 +21,6 @@ - <% import addons %> <% template1 = helper.get_mako_template('account_financial_report_webkit','report', 'templates', 'open_invoices_inclusion.mako.html') %> <% context.lookup.put_template('open_invoices_inclusion.mako.html', template1) %> <% template2 = helper.get_mako_template('account_financial_report_webkit','report', 'templates', 'grouped_by_curr_open_invoices_inclusion.mako.html') %> @@ -73,7 +72,7 @@ %for acc in objects: - %if hasattr(acc, 'grouped_ledger_lines'): + %if 'grouped_ledger_lines' in acc: <% fl = formatLang %> <%include file="grouped_by_curr_open_invoices_inclusion.mako.html" args="account=acc,formatLang=fl"/> %else: