From 407b53b64459a3bab93790c0e3d28b89766c54b1 Mon Sep 17 00:00:00 2001 From: "Guewen Baconnier @ Camptocamp" Date: Tue, 11 Dec 2012 14:53:10 +0100 Subject: [PATCH 01/16] [FIX] reapply fixes from main branch --- .../report/webkit_parser_header_fix.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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 da186ee0..c84166c5 100644 --- a/account_financial_report_webkit/report/webkit_parser_header_fix.py +++ b/account_financial_report_webkit/report/webkit_parser_header_fix.py @@ -34,12 +34,12 @@ import time import pooler import tools import logging -import openerp.addons from mako import exceptions from osv.osv import except_osv from tools.translate import _ +from openerp import addons 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 @@ -79,7 +79,6 @@ class HeaderFooterTextWebKitParser(webkit_report.WebKitParser): webkit_header = report_xml.webkit_header tmp_dir = tempfile.gettempdir() out_filename = tempfile.mktemp(suffix=".pdf", prefix="webkit.tmp.") - files = [] file_to_del = [out_filename] if comm_path: command = [comm_path] @@ -120,8 +119,8 @@ class HeaderFooterTextWebKitParser(webkit_report.WebKitParser): file_to_del.append(stderr_path) try: status = subprocess.call(command, stderr=stderr_fd) - os.close(stderr_fd) # force flush - stderr_fd = None # avoid closing again in finally + os.close(stderr_fd) # ensure flush before reading + stderr_fd = None # avoid closing again in finally block fobj = open(stderr_path, 'r') error_message = fobj.read() fobj.close() @@ -167,7 +166,7 @@ class HeaderFooterTextWebKitParser(webkit_report.WebKitParser): template = False if report_xml.report_file : - path =openerp.addons.get_module_resource(report_xml.report_file) + path = addons.get_module_resource(*report_xml.report_file.split(os.path.sep)) if os.path.exists(path) : template = file(path).read() if not template and report_xml.report_webkit_data : @@ -233,3 +232,4 @@ class HeaderFooterTextWebKitParser(webkit_report.WebKitParser): bin = self.get_lib(cursor, uid) pdf = self.generate_pdf(bin, report_xml, head, foot, htmls) return (pdf, 'pdf') + From 3ac09540d20b1279f9ea5046467c7edc18872ac7 Mon Sep 17 00:00:00 2001 From: "Guewen Baconnier @ Camptocamp" Date: Tue, 11 Dec 2012 15:05:02 +0100 Subject: [PATCH 02/16] [FIX] res_users.context_lang -> res_users.lang --- .../report/templates/account_report_general_ledger.mako | 2 +- .../report/templates/account_report_open_invoices.mako | 2 +- .../report/templates/account_report_partner_balance.mako | 2 +- .../report/templates/account_report_partners_ledger.mako | 2 +- .../report/templates/account_report_profit_loss.mako | 2 +- .../report/templates/account_report_trial_balance.mako | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/account_financial_report_webkit/report/templates/account_report_general_ledger.mako b/account_financial_report_webkit/report/templates/account_report_general_ledger.mako index 6ed7b4a5..1796a51f 100644 --- a/account_financial_report_webkit/report/templates/account_report_general_ledger.mako +++ b/account_financial_report_webkit/report/templates/account_report_general_ledger.mako @@ -16,7 +16,7 @@ return text.replace('-', '‑') # replace by a non-breaking hyphen (it will not word-wrap between hyphen and numbers) %> - <%setLang(user.context_lang)%> + <%setLang(user.lang)%> <% initial_balance_text = {'initial_balance': _('Computed'), 'opening_balance': _('Opening Entries'), False: _('No')} 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 ffe102dc..02dc6952 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 @@ -26,7 +26,7 @@ <% 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') %> <% context.lookup.put_template('grouped_by_curr_open_invoices_inclusion.mako.html', template2) %> - <%setLang(user.context_lang)%> + <%setLang(user.lang)%>
diff --git a/account_financial_report_webkit/report/templates/account_report_partner_balance.mako b/account_financial_report_webkit/report/templates/account_report_partner_balance.mako index dd3ab367..b54e35ee 100644 --- a/account_financial_report_webkit/report/templates/account_report_partner_balance.mako +++ b/account_financial_report_webkit/report/templates/account_report_partner_balance.mako @@ -32,7 +32,7 @@ return any([line.get('balance') for line in all_comparison_lines]) %> - <%setLang(user.context_lang)%> + <%setLang(user.lang)%> <% initial_balance_text = {'initial_balance': _('Computed'), 'opening_balance': _('Opening Entries'), False: _('No')} diff --git a/account_financial_report_webkit/report/templates/account_report_partners_ledger.mako b/account_financial_report_webkit/report/templates/account_report_partners_ledger.mako index 9182b7ed..22fdc3a2 100644 --- a/account_financial_report_webkit/report/templates/account_report_partners_ledger.mako +++ b/account_financial_report_webkit/report/templates/account_report_partners_ledger.mako @@ -17,7 +17,7 @@ return text.replace('-', '‑') # replace by a non-breaking hyphen (it will not word-wrap between hyphen and numbers) %> - <%setLang(user.context_lang)%> + <%setLang(user.lang)%> <% initial_balance_text = {'initial_balance': _('Computed'), 'opening_balance': _('Opening Entries'), False: _('No')} diff --git a/account_financial_report_webkit/report/templates/account_report_profit_loss.mako b/account_financial_report_webkit/report/templates/account_report_profit_loss.mako index 494b310f..f0f6bcf8 100644 --- a/account_financial_report_webkit/report/templates/account_report_profit_loss.mako +++ b/account_financial_report_webkit/report/templates/account_report_profit_loss.mako @@ -32,7 +32,7 @@ ${output} - <%setLang(user.context_lang)%> + <%setLang(user.lang)%>
diff --git a/account_financial_report_webkit/report/templates/account_report_trial_balance.mako b/account_financial_report_webkit/report/templates/account_report_trial_balance.mako index 8efd7647..c938ea4a 100644 --- a/account_financial_report_webkit/report/templates/account_report_trial_balance.mako +++ b/account_financial_report_webkit/report/templates/account_report_trial_balance.mako @@ -41,7 +41,7 @@ return text.replace('-', '‑') # replace by a non-breaking hyphen (it will not word-wrap between hyphen and numbers) %> - <%setLang(user.context_lang)%> + <%setLang(user.lang)%> <% initial_balance_text = {'initial_balance': _('Computed'), 'opening_balance': _('Opening Entries'), False: _('No')} From a0a5ce57eadfcc342ecf211de4da6c1a613d91d2 Mon Sep 17 00:00:00 2001 From: "Guewen Baconnier @ Camptocamp" Date: Tue, 11 Dec 2012 15:20:36 +0100 Subject: [PATCH 03/16] [FIX] no longer display the last reconciliation date in the account move lines, no a lot of space and this is a useless data for the user --- .../__openerp__.py | 1 - .../account_move_line_view.xml | 23 ------------------- 2 files changed, 24 deletions(-) delete mode 100644 account_financial_report_webkit/account_move_line_view.xml diff --git a/account_financial_report_webkit/__openerp__.py b/account_financial_report_webkit/__openerp__.py index d756e2b3..5b21d08d 100644 --- a/account_financial_report_webkit/__openerp__.py +++ b/account_financial_report_webkit/__openerp__.py @@ -107,7 +107,6 @@ wkhtmltopdf. The texts are defined inside the report classes. 'init_xml': [], 'demo_xml' : [], 'update_xml': ['account_view.xml', - 'account_move_line_view.xml', 'data/financial_webkit_header.xml', 'report/report.xml', 'wizard/wizard.xml', diff --git a/account_financial_report_webkit/account_move_line_view.xml b/account_financial_report_webkit/account_move_line_view.xml deleted file mode 100644 index a99a8e9d..00000000 --- a/account_financial_report_webkit/account_move_line_view.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - last_rec_date_form - account.move.line - - - - form - - - - - - - - - - - - From 01ca64e8647e4027afe867417d042d1831896cb2 Mon Sep 17 00:00:00 2001 From: "Guewen Baconnier @ Camptocamp" Date: Tue, 11 Dec 2012 15:43:51 +0100 Subject: [PATCH 04/16] [FIX] no labels on checkboxes --- .../wizard/general_ledger_wizard_view.xml | 6 ++++-- .../wizard/partners_ledger_wizard_view.xml | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/account_financial_report_webkit/wizard/general_ledger_wizard_view.xml b/account_financial_report_webkit/wizard/general_ledger_wizard_view.xml index a7bce96d..5045bc53 100644 --- a/account_financial_report_webkit/wizard/general_ledger_wizard_view.xml +++ b/account_financial_report_webkit/wizard/general_ledger_wizard_view.xml @@ -32,8 +32,10 @@ - - + + + + diff --git a/account_financial_report_webkit/wizard/partners_ledger_wizard_view.xml b/account_financial_report_webkit/wizard/partners_ledger_wizard_view.xml index fa165c59..43ae74d2 100644 --- a/account_financial_report_webkit/wizard/partners_ledger_wizard_view.xml +++ b/account_financial_report_webkit/wizard/partners_ledger_wizard_view.xml @@ -25,7 +25,9 @@ - + + + From 8a824acdb6d74f688b41fd1012f2e204ca10662c Mon Sep 17 00:00:00 2001 From: "Guewen Baconnier @ Camptocamp" Date: Tue, 11 Dec 2012 15:46:44 +0100 Subject: [PATCH 05/16] [FIX] views: remove the useless type of views --- account_financial_report_webkit/account_view.xml | 1 - .../wizard/general_ledger_wizard_view.xml | 2 -- .../wizard/open_invoices_wizard_view.xml | 1 - .../wizard/partner_balance_wizard_view.xml | 1 - .../wizard/partners_ledger_wizard_view.xml | 1 - .../wizard/profit_loss_wizard_view.xml | 1 - .../wizard/trial_balance_wizard_view.xml | 1 - 7 files changed, 8 deletions(-) diff --git a/account_financial_report_webkit/account_view.xml b/account_financial_report_webkit/account_view.xml index 60666774..ed56b119 100644 --- a/account_financial_report_webkit/account_view.xml +++ b/account_financial_report_webkit/account_view.xml @@ -5,7 +5,6 @@ account.account.form.webkit account.account - form diff --git a/account_financial_report_webkit/wizard/general_ledger_wizard_view.xml b/account_financial_report_webkit/wizard/general_ledger_wizard_view.xml index 5045bc53..c0083163 100644 --- a/account_financial_report_webkit/wizard/general_ledger_wizard_view.xml +++ b/account_financial_report_webkit/wizard/general_ledger_wizard_view.xml @@ -5,7 +5,6 @@ General Ledger general.ledger.webkit - form @@ -57,7 +56,6 @@ General Ledger general.ledger.webkit - form diff --git a/account_financial_report_webkit/wizard/open_invoices_wizard_view.xml b/account_financial_report_webkit/wizard/open_invoices_wizard_view.xml index aa1dfad2..cf8205dd 100644 --- a/account_financial_report_webkit/wizard/open_invoices_wizard_view.xml +++ b/account_financial_report_webkit/wizard/open_invoices_wizard_view.xml @@ -5,7 +5,6 @@ Open Invoices Report open.invoices.webkit - form diff --git a/account_financial_report_webkit/wizard/partner_balance_wizard_view.xml b/account_financial_report_webkit/wizard/partner_balance_wizard_view.xml index e1dfdc3f..55a04292 100644 --- a/account_financial_report_webkit/wizard/partner_balance_wizard_view.xml +++ b/account_financial_report_webkit/wizard/partner_balance_wizard_view.xml @@ -9,7 +9,6 @@ Partner Balance partner.balance.webkit - form diff --git a/account_financial_report_webkit/wizard/partners_ledger_wizard_view.xml b/account_financial_report_webkit/wizard/partners_ledger_wizard_view.xml index 43ae74d2..88d4f948 100644 --- a/account_financial_report_webkit/wizard/partners_ledger_wizard_view.xml +++ b/account_financial_report_webkit/wizard/partners_ledger_wizard_view.xml @@ -5,7 +5,6 @@ Partner Ledger partners.ledger.webkit - form diff --git a/account_financial_report_webkit/wizard/profit_loss_wizard_view.xml b/account_financial_report_webkit/wizard/profit_loss_wizard_view.xml index 0f5c63fa..08aa06d2 100644 --- a/account_financial_report_webkit/wizard/profit_loss_wizard_view.xml +++ b/account_financial_report_webkit/wizard/profit_loss_wizard_view.xml @@ -5,7 +5,6 @@ Profit and Loss Webkit profit.loss.webkit - form diff --git a/account_financial_report_webkit/wizard/trial_balance_wizard_view.xml b/account_financial_report_webkit/wizard/trial_balance_wizard_view.xml index cfdf39e8..fe91d25d 100644 --- a/account_financial_report_webkit/wizard/trial_balance_wizard_view.xml +++ b/account_financial_report_webkit/wizard/trial_balance_wizard_view.xml @@ -9,7 +9,6 @@ Trial Balance trial.balance.webkit - form From 1b29cf15e8443b8056f5531720b6e489594103b5 Mon Sep 17 00:00:00 2001 From: "Guewen Baconnier @ Camptocamp" Date: Tue, 11 Dec 2012 16:34:07 +0100 Subject: [PATCH 06/16] [FIX] dynamic wizards for comparisons --- .../wizard/balance_common.py | 72 +++++++++++++------ 1 file changed, 52 insertions(+), 20 deletions(-) diff --git a/account_financial_report_webkit/wizard/balance_common.py b/account_financial_report_webkit/wizard/balance_common.py index bee3949b..099566fe 100644 --- a/account_financial_report_webkit/wizard/balance_common.py +++ b/account_financial_report_webkit/wizard/balance_common.py @@ -142,26 +142,58 @@ class AccountBalanceCommonWizard(osv.osv_memory): placeholder = placeholder[0] for index in range(self.COMPARISON_LEVEL): page = etree.Element('page', {'name': "comp%s" % (index,), 'string': _("Comparison %s") % (index+1,)}) - page.append(etree.Element('field', {'name': "comp%s_filter" % (index,), - 'colspan': '4', - 'on_change': "onchange_comp_filter(%(index)s, filter, comp%(index)s_filter, fiscalyear_id, date_from, date_to)" % {'index': index}})) - page.append(etree.Element('field', {'name': "comp%s_fiscalyear_id" % (index,), - 'colspan': '4', - 'attrs': "{'required': [('comp%(index)s_filter','in',('filter_year','filter_opening'))], 'readonly':[('comp%(index)s_filter','not in',('filter_year','filter_opening'))]}" % {'index': index}})) - page.append(etree.Element('separator', {'string': _('Dates'), 'colspan':'4'})) - page.append(etree.Element('field', {'name': "comp%s_date_from" % (index,), 'colspan':'4', - 'attrs': "{'required': [('comp%(index)s_filter','=','filter_date')], 'readonly':[('comp%(index)s_filter','!=','filter_date')]}" % {'index': index}})) - page.append(etree.Element('field', {'name': "comp%s_date_to" % (index,), 'colspan':'4', - 'attrs': "{'required': [('comp%(index)s_filter','=','filter_date')], 'readonly':[('comp%(index)s_filter','!=','filter_date')]}" % {'index': index}})) - page.append(etree.Element('separator', {'string': _('Periods'), 'colspan':'4'})) - page.append(etree.Element('field', {'name': "comp%s_period_from" % (index,), - 'colspan': '4', - 'attrs': "{'required': [('comp%(index)s_filter','=','filter_period')], 'readonly':[('comp%(index)s_filter','!=','filter_period')]}" % {'index': index}, - 'domain': "[('special', '=', False)]"})) - page.append(etree.Element('field', {'name': "comp%s_period_to" % (index,), - 'colspan': '4', - 'attrs': "{'required': [('comp%(index)s_filter','=','filter_period')], 'readonly':[('comp%(index)s_filter','!=','filter_period')]}" % {'index': index}, - 'domain': "[('special', '=', False)]"})) + group = etree.Element('group') + page.append(group) + def modifiers_and_append(elem): + orm.setup_modifiers(elem) + group.append(elem) + + modifiers_and_append(etree.Element( + 'field', + {'name': "comp%s_filter" % index, + 'on_change': "onchange_comp_filter(%(index)s, filter, comp%(index)s_filter, fiscalyear_id, date_from, date_to)" % {'index': index}})) + modifiers_and_append(etree.Element( + 'field', + {'name': "comp%s_fiscalyear_id" % index, + 'attrs': + "{'required': [('comp%(index)s_filter','in',('filter_year','filter_opening'))]," \ + " 'invisible': [('comp%(index)s_filter','not in',('filter_year','filter_opening'))]}" % {'index': index}})) + + + dates_attrs = "{'required': [('comp%(index)s_filter','=','filter_date')], " \ + " 'invisible': [('comp%(index)s_filter','!=','filter_date')]}" % {'index': index} + modifiers_and_append(etree.Element( + 'separator', + {'string': _('Dates'), + 'colspan': '4', + 'attrs': dates_attrs})) + modifiers_and_append(etree.Element( + 'field', + {'name': "comp%s_date_from" % index, + 'attrs': dates_attrs})) + modifiers_and_append(etree.Element( + 'field', + {'name': "comp%s_date_to" % index, + 'attrs': dates_attrs})) + + periods_attrs = "{'required': [('comp%(index)s_filter','=','filter_period')]," \ + " 'invisible': [('comp%(index)s_filter','!=','filter_period')]}" % {'index': index} + periods_domain = "[('special', '=', False)]" + modifiers_and_append(etree.Element( + 'separator', + {'string': _('Periods'), + 'colspan': '4', + 'attrs': periods_attrs})) + modifiers_and_append(etree.Element( + 'field', + {'name': "comp%s_period_from" % index, + 'attrs': periods_attrs, + 'domain': periods_domain})) + modifiers_and_append(etree.Element( + 'field', + {'name': "comp%s_period_to" % index, + 'attrs': periods_attrs, + 'domain': periods_domain})) placeholder.addprevious(page) placeholder.getparent().remove(placeholder) From 842b7f6000e587b1cdcfb3801235282b4d0d22d1 Mon Sep 17 00:00:00 2001 From: "Guewen Baconnier @ Camptocamp" Date: Tue, 11 Dec 2012 17:32:26 +0100 Subject: [PATCH 07/16] [FIX] use openerp absolute imports and apply pep8 (excepted the lines length) --- account_financial_report_webkit/account.py | 12 ++-- .../account_move_line.py | 24 +++---- .../report/common_balance_reports.py | 21 ++++-- .../report/common_partner_balance_reports.py | 13 ++-- .../report/common_partner_reports.py | 16 +++-- .../report/common_reports.py | 40 ++++++----- .../report/general_ledger.py | 17 ++--- .../report/open_invoices.py | 20 +++--- .../report/partner_balance.py | 12 ++-- .../report/partners_ledger.py | 14 ++-- .../report/trial_balance.py | 14 ++-- .../report/webkit_parser_header_fix.py | 5 +- .../wizard/balance_common.py | 66 ++++++++++++------- .../wizard/general_ledger_wizard.py | 30 +++++---- .../wizard/open_invoices_wizard.py | 33 ++++------ .../wizard/partner_balance_wizard.py | 15 ++--- .../wizard/partners_ledger_wizard.py | 14 ++-- 17 files changed, 194 insertions(+), 172 deletions(-) diff --git a/account_financial_report_webkit/account.py b/account_financial_report_webkit/account.py index d7d28f30..1c82a993 100644 --- a/account_financial_report_webkit/account.py +++ b/account_financial_report_webkit/account.py @@ -28,18 +28,20 @@ # ############################################################################## -from osv import osv, fields +from openerp.osv import fields, orm -class AccountAccount(osv.osv): +class AccountAccount(orm.Model): _inherit = 'account.account' _columns = { - 'centralized': fields.boolean('Centralized', help="If flagged, no details will be displayed in the General Ledger report (the webkit one only), only centralized amounts per period.") + 'centralized': fields.boolean( + 'Centralized', + help="If flagged, no details will be displayed in " + "the General Ledger report (the webkit one only), " + "only centralized amounts per period.") } _defaults = { 'centralized': False, } - -AccountAccount() diff --git a/account_financial_report_webkit/account_move_line.py b/account_financial_report_webkit/account_move_line.py index 2e96728f..617908bc 100644 --- a/account_financial_report_webkit/account_move_line.py +++ b/account_financial_report_webkit/account_move_line.py @@ -19,34 +19,33 @@ # ############################################################################## -from osv import fields, osv -from tools.translate import _ +from openerp.osv import fields, orm +from openerp.tools.translate import _ -class AccountMoveLine(osv.osv): +class AccountMoveLine(orm.Model): """Overriding Account move line in order to add last_rec_date. Last rec date is the date of the last reconciliation (full or partial) account move line""" _inherit = 'account.move.line' - + def init(self, cr): ##We do not want to catch error as if sql is not run it will give invalid data cr.execute("UPDATE account_move_line as acm " - " SET last_rec_date =" + " SET last_rec_date =" " (SELECT date from account_move_line" " WHERE reconcile_id = acm.reconcile_id" " AND reconcile_id IS NOT NULL" " ORDER BY date DESC LIMIT 1)" " WHERE last_rec_date is null;") - + cr.execute("UPDATE account_move_line as acm " - " SET last_rec_date =" + " SET last_rec_date =" " (SELECT date from account_move_line" " WHERE reconcile_partial_id = acm.reconcile_partial_id" " AND reconcile_partial_id IS NOT NULL" " ORDER BY date DESC LIMIT 1)" " WHERE last_rec_date is null;") - - + def _get_move_line_from_line_rec(self, cr, uid, ids, context=None): moves = [] for reconcile in self.pool.get('account.move.reconcile').browse(cr, uid, ids, context=context): @@ -55,7 +54,7 @@ class AccountMoveLine(osv.osv): for move_line in reconcile.line_id: moves.append(move_line.id) return list(set(moves)) - + def _get_last_rec_date(self, cursor, uid, ids, name, args, context=None): if not isinstance(ids, list): ids = [ids] @@ -79,11 +78,8 @@ class AccountMoveLine(osv.osv): method=True, string='Last reconciliation date', store={'account.move.line': (lambda self, cr, uid, ids, c={}: ids, ['date'], 20), - 'account.move.reconcile': (_get_move_line_from_line_rec, None ,20)}, + 'account.move.reconcile': (_get_move_line_from_line_rec, None, 20)}, type='date', multi='all', help="the date of the last reconciliation (full or partial) account move line"), - } - -AccountMoveLine() diff --git a/account_financial_report_webkit/report/common_balance_reports.py b/account_financial_report_webkit/report/common_balance_reports.py index 53700aba..52e38a6c 100644 --- a/account_financial_report_webkit/report/common_balance_reports.py +++ b/account_financial_report_webkit/report/common_balance_reports.py @@ -22,7 +22,7 @@ from operator import add -from common_reports import CommonReportHeaderWebkit +from .common_reports import CommonReportHeaderWebkit class CommonBalanceReportHeaderWebkit(CommonReportHeaderWebkit): @@ -73,12 +73,17 @@ class CommonBalanceReportHeaderWebkit(CommonReportHeaderWebkit): 'all_fiscalyear': True}) if use_period_ids: - ctx.update({'periods': period_ids,}) + ctx.update({'periods': period_ids}) elif main_filter == 'filter_date': ctx.update({'date_from': start, 'date_to': stop}) - accounts = account_obj.read(self.cursor, self.uid, account_ids, ['type','code','name','debit','credit', 'balance', 'parent_id','level','child_id'], ctx) + accounts = account_obj.read( + self.cursor, + self.uid, + account_ids, + ['type', 'code', 'name', 'debit', 'credit', 'balance', 'parent_id', 'level', 'child_id'], + ctx) accounts_by_id = {} for account in accounts: @@ -86,7 +91,11 @@ class CommonBalanceReportHeaderWebkit(CommonReportHeaderWebkit): # sum for top level views accounts child_ids = account_obj._get_children_and_consol(self.cursor, self.uid, account['id'], ctx) if child_ids: - child_init_balances = [init_bal['init_balance'] for acnt_id, init_bal in init_balance.iteritems() if acnt_id in child_ids ] + child_init_balances = [ \ + init_bal['init_balance'] \ + for acnt_id, init_bal \ + in init_balance.iteritems() \ + if acnt_id in child_ids] top_init_balance = reduce(add, child_init_balances) account['init_balance'] = top_init_balance else: @@ -154,7 +163,7 @@ class CommonBalanceReportHeaderWebkit(CommonReportHeaderWebkit): return {'diff': diff, 'percent_diff': percent_diff} def _comp_filters(self, data, comparison_number): - """ + """ @param data: data of the report @param comparison_number: number of comparisons @return: list of comparison filters, nb of comparisons used and comparison mode (no_comparison, single, multiple) @@ -162,7 +171,7 @@ class CommonBalanceReportHeaderWebkit(CommonReportHeaderWebkit): comp_filters = [] for index in range(comparison_number): comp_filters.append(self._get_form_param("comp%s_filter" % (index,), data, default='filter_no')) - + nb_comparisons = len([comp_filter for comp_filter in comp_filters if comp_filter != 'filter_no']) if not nb_comparisons: comparison_mode = 'no_comparison' diff --git a/account_financial_report_webkit/report/common_partner_balance_reports.py b/account_financial_report_webkit/report/common_partner_balance_reports.py index c0dba07d..eeec0c53 100644 --- a/account_financial_report_webkit/report/common_partner_balance_reports.py +++ b/account_financial_report_webkit/report/common_partner_balance_reports.py @@ -23,8 +23,8 @@ from collections import defaultdict from operator import add -from common_balance_reports import CommonBalanceReportHeaderWebkit -from common_partner_reports import CommonPartnersReportHeaderWebkit +from .common_balance_reports import CommonBalanceReportHeaderWebkit +from .common_partner_reports import CommonPartnersReportHeaderWebkit class CommonPartnerBalanceReportHeaderWebkit(CommonBalanceReportHeaderWebkit, CommonPartnersReportHeaderWebkit): @@ -95,21 +95,22 @@ class CommonPartnerBalanceReportHeaderWebkit(CommonBalanceReportHeaderWebkit, Co FROM account_move_line""" sql_joins = '' sql_where = "WHERE account_move_line.account_id = %(account_id)s AND account_move_line.state = 'valid' " - sql_conditions, search_params = getattr(self, '_get_query_params_from_'+filter_from+'s')(start, stop, mode=mode) + method = getattr(self, '_get_query_params_from_' + filter_from + 's') + sql_conditions, search_params = method(start, stop, mode=mode) sql_where += sql_conditions if partner_filter_ids: sql_where += " AND account_move_line.partner_id in %(partner_ids)s" - search_params.update({'partner_ids': tuple(partner_filter_ids),}) + search_params.update({'partner_ids': tuple(partner_filter_ids)}) if target_move == 'posted': sql_joins += "INNER JOIN account_move ON account_move_line.move_id = account_move.id" sql_where += " AND account_move.state = %(target_move)s" - search_params.update({'target_move': target_move,}) + search_params.update({'target_move': target_move}) sql_groupby = "GROUP BY account_move_line.partner_id" - search_params.update({'account_id': account_id,}) + search_params.update({'account_id': account_id}) query = ' '.join((sql_select, sql_joins, sql_where, sql_groupby)) self.cursor.execute(query, search_params) diff --git a/account_financial_report_webkit/report/common_partner_reports.py b/account_financial_report_webkit/report/common_partner_reports.py index deb5122d..38113353 100644 --- a/account_financial_report_webkit/report/common_partner_reports.py +++ b/account_financial_report_webkit/report/common_partner_reports.py @@ -26,7 +26,7 @@ from collections import defaultdict from datetime import datetime from openerp.tools import DEFAULT_SERVER_DATE_FORMAT -from common_reports import CommonReportHeaderWebkit +from .common_reports import CommonReportHeaderWebkit class CommonPartnersReportHeaderWebkit(CommonReportHeaderWebkit): @@ -164,7 +164,8 @@ class CommonPartnersReportHeaderWebkit(CommonReportHeaderWebkit): sql_where = " WHERE account_move_line.account_id = %(account_ids)s " \ " AND account_move_line.state = 'valid' " - sql_conditions, search_params = getattr(self, '_get_query_params_from_'+filter_from+'s')(start, stop) + method = getattr(self, '_get_query_params_from_' + filter_from + 's') + sql_conditions, search_params = method(start, stop) sql_where += sql_conditions @@ -178,7 +179,7 @@ class CommonPartnersReportHeaderWebkit(CommonReportHeaderWebkit): if target_move == 'posted': sql_joins += "INNER JOIN account_move ON account_move_line.move_id = account_move.id" sql_where += " AND account_move.state = %(target_move)s" - search_params.update({'target_move': target_move,}) + search_params.update({'target_move': target_move}) search_params.update({ 'account_ids': account_id, @@ -247,9 +248,11 @@ class CommonPartnersReportHeaderWebkit(CommonReportHeaderWebkit): if not period_ids: period_ids = [-1] - search_param = {'date_start': start_period.date_start, - 'period_ids': tuple(period_ids), - 'account_ids': tuple(account_ids),} + search_param = { + 'date_start': start_period.date_start, + 'period_ids': tuple(period_ids), + 'account_ids': tuple(account_ids), + } sql = ("SELECT ml.id, ml.account_id, ml.partner_id " "FROM account_move_line ml " "INNER JOIN account_account a " @@ -325,4 +328,3 @@ class CommonPartnersReportHeaderWebkit(CommonReportHeaderWebkit): if not res: return [] return res - diff --git a/account_financial_report_webkit/report/common_reports.py b/account_financial_report_webkit/report/common_reports.py index ab37d18d..a09b734a 100644 --- a/account_financial_report_webkit/report/common_reports.py +++ b/account_financial_report_webkit/report/common_reports.py @@ -24,25 +24,25 @@ import logging +from openerp.osv import osv +from openerp.tools.translate import _ from openerp.addons.account.report.common_report_header import common_report_header -from osv import osv -from tools.translate import _ - _logger = logging.getLogger('financial.reports.webkit') + class CommonReportHeaderWebkit(common_report_header): """Define common helper for financial report""" ####################From getter helper ##################################### def get_start_period_br(self, data): - return self._get_info(data,'period_from', 'account.period') + return self._get_info(data, 'period_from', 'account.period') def get_end_period_br(self, data): - return self._get_info(data,'period_to', 'account.period') + return self._get_info(data, 'period_to', 'account.period') def get_fiscalyear_br(self, data): - return self._get_info(data,'fiscalyear_id', 'account.fiscalyear') + return self._get_info(data, 'fiscalyear_id', 'account.fiscalyear') def _get_chart_account_id_br(self, data): return self._get_info(data, 'chart_account_id', 'account.account') @@ -109,8 +109,6 @@ class CommonReportHeaderWebkit(common_report_header): def _get_form_param(self, param, data, default=False): return data.get('form', {}).get(param, default) - - ####################Account and account line filter helper ################# def sort_accounts_with_structure(self, root_account_ids, account_ids, context=None): @@ -119,11 +117,11 @@ class CommonReportHeaderWebkit(common_report_header): def recursive_sort_by_code(accounts, parent): sorted_accounts = [] # add all accounts with same parent - level_accounts = [account for account in accounts + level_accounts = [account for account in accounts if account['parent_id'] and account['parent_id'][0] == parent['id']] # add consolidation children of parent, as they are logically on the same level if parent.get('child_consol_ids'): - level_accounts.extend([account for account in accounts + level_accounts.extend([account for account in accounts if account['id'] in parent['child_consol_ids']]) # stop recursion if no children found if not level_accounts: @@ -143,7 +141,7 @@ class CommonReportHeaderWebkit(common_report_header): account_ids, ['id', 'parent_id', 'level', 'code', 'child_consol_ids'], context=context) - + sorted_accounts = [] root_accounts_data = [account_data for account_data in accounts_data @@ -221,7 +219,7 @@ class CommonReportHeaderWebkit(common_report_header): def get_included_opening_period(self, period): """Return the opening included in normal period we use the assumption that there is only one opening period per fiscal year""" - period_obj = self.pool.get('account.period') + period_obj = self.pool.get('account.period') return period_obj.search(self.cursor, self.uid, [('special', '=', True), ('date_start', '>=', period.date_start), @@ -285,7 +283,7 @@ class CommonReportHeaderWebkit(common_report_header): if not include_opening: periods_search += [('special', '=', False)] - if fiscalyear : + if fiscalyear: periods_search.append(('fiscalyear_id', '=', fiscalyear.id)) periods = period_obj.search(self.cursor, self.uid, periods_search) if include_opening and opening_period_id: @@ -305,12 +303,12 @@ class CommonReportHeaderWebkit(common_report_header): period_obj = self.pool.get('account.period') p_id = period_obj.search(self.cursor, self.uid, - [('special','=', special), + [('special', '=', special), ('fiscalyear_id', '=', fiscalyear.id)], limit=1, order='date_start %s' % (order,)) if not p_id: - raise osv.except_osv(_('No period found'),'') + raise osv.except_osv(_('No period found'), '') return period_obj.browse(self.cursor, self.uid, p_id[0]) ####################Initial Balance helper ################################# @@ -401,7 +399,7 @@ class CommonReportHeaderWebkit(common_report_header): def _get_move_ids_from_dates(self, account_id, date_start, date_stop, target_move, mode='include_opening'): # TODO imporve perfomance by setting opening period as a property move_line_obj = self.pool.get('account.move.line') - search_period = [('date', '>=', date_start), + search_period = [('date', '>=', date_start), ('date', '<=', date_stop), ('account_id', '=', account_id)] @@ -424,7 +422,7 @@ class CommonReportHeaderWebkit(common_report_header): if main_filter in ('filter_period', 'filter_no'): return self._get_move_ids_from_periods(account_id, start, stop, target_move) - + elif main_filter == 'filter_date': return self._get_move_ids_from_dates(account_id, start, stop, target_move) else: @@ -435,7 +433,7 @@ class CommonReportHeaderWebkit(common_report_header): return [] if not isinstance(move_line_ids, list): move_line_ids = [move_line_ids] - monster =""" + monster = """ SELECT l.id AS id, l.date AS ldate, j.code AS jcode , @@ -473,7 +471,7 @@ FROM account_move_line l monster += (" ORDER BY %s" % (order,)) try: self.cursor.execute(monster, (tuple(move_line_ids),)) - res= self.cursor.dictfetchall() + res = self.cursor.dictfetchall() except Exception, exc: self.cursor.rollback() raise @@ -500,8 +498,8 @@ WHERE move_id in %s""" try: self.cursor.execute(sql, (account_id, limit, tuple(move_ids))) - res= self.cursor.fetchall() - except Exception, exc: + res = self.cursor.fetchall() + except Exception as exc: self.cursor.rollback() raise return res and dict(res) or {} diff --git a/account_financial_report_webkit/report/general_ledger.py b/account_financial_report_webkit/report/general_ledger.py index 5244ea07..535f8499 100644 --- a/account_financial_report_webkit/report/general_ledger.py +++ b/account_financial_report_webkit/report/general_ledger.py @@ -19,15 +19,16 @@ # ############################################################################## -from report import report_sxw -from tools.translate import _ -import pooler from operator import itemgetter from itertools import groupby from datetime import datetime -from common_reports import CommonReportHeaderWebkit -from webkit_parser_header_fix import HeaderFooterTextWebKitParser +from openerp.report import report_sxw +from openerp import pooler +from openerp.tools.translate import _ +from .common_reports import CommonReportHeaderWebkit +from .webkit_parser_header_fix import HeaderFooterTextWebKitParser + class GeneralLedgerWebkit(report_sxw.rml_parse, CommonReportHeaderWebkit): @@ -35,7 +36,7 @@ class GeneralLedgerWebkit(report_sxw.rml_parse, CommonReportHeaderWebkit): super(GeneralLedgerWebkit, self).__init__(cursor, uid, name, context=context) self.pool = pooler.get_pool(self.cr.dbname) self.cursor = self.cr - + company = self.pool.get('res.users').browse(self.cr, uid, uid, context=context).company_id header_report_name = ' - '.join((_('GENERAL LEDGER'), company.name, company.currency_id.name)) @@ -158,14 +159,14 @@ class GeneralLedgerWebkit(report_sxw.rml_parse, CommonReportHeaderWebkit): period_obj = self.pool.get('account.period') # we need to sort the lines per period in order to use groupby # unique ids of each used period id in lines - period_ids = list(set([line['lperiod_id'] for line in ledger_lines ])) + period_ids = list(set([line['lperiod_id'] for line in ledger_lines])) # search on account.period in order to sort them by date_start sorted_period_ids = period_obj.search(self.cr, self.uid, [('id', 'in', period_ids)], order='special desc, date_start', context=context) sorted_ledger_lines = sorted(ledger_lines, key=lambda x: sorted_period_ids.index(x['lperiod_id'])) - + for period_id, lines_per_period_iterator in groupby(sorted_ledger_lines, itemgetter('lperiod_id')): lines_per_period = list(lines_per_period_iterator) if not lines_per_period: diff --git a/account_financial_report_webkit/report/open_invoices.py b/account_financial_report_webkit/report/open_invoices.py index a6bd720f..c49c82f4 100644 --- a/account_financial_report_webkit/report/open_invoices.py +++ b/account_financial_report_webkit/report/open_invoices.py @@ -18,7 +18,6 @@ # along with this program. If not, see . # ############################################################################## -import pooler from collections import defaultdict from report import report_sxw @@ -27,21 +26,23 @@ from itertools import groupby from operator import itemgetter from mako.template import Template -from tools.translate import _ +import openerp.addons +from openerp import pooler from openerp.osv import osv -from common_partner_reports import CommonPartnersReportHeaderWebkit -from webkit_parser_header_fix import HeaderFooterTextWebKitParser +from openerp.tools.translate import _ from openerp.addons.report_webkit import report_helper -import addons +from .common_partner_reports import CommonPartnersReportHeaderWebkit +from .webkit_parser_header_fix import HeaderFooterTextWebKitParser def get_mako_template(obj, *args): - template_path = addons.get_module_resource(*args) + template_path = openerp.addons.get_module_resource(*args) return Template(filename=template_path, input_encoding='utf-8') report_helper.WebKitHelper.get_mako_template = get_mako_template + class PartnersOpenInvoicesWebkit(report_sxw.rml_parse, CommonPartnersReportHeaderWebkit): def __init__(self, cursor, uid, name, context): @@ -57,7 +58,7 @@ class PartnersOpenInvoicesWebkit(report_sxw.rml_parse, CommonPartnersReportHeade self.localcontext.update({ 'cr': cursor, 'uid': uid, - 'report_name':_('Open Invoices Report'), + 'report_name': _('Open Invoices Report'), 'display_account_raw': self._get_display_account_raw, 'filter_form': self._get_filter, 'target_move': self._get_target_move, @@ -77,7 +78,6 @@ class PartnersOpenInvoicesWebkit(report_sxw.rml_parse, CommonPartnersReportHeade ], }) - def _group_lines_by_currency(self, account_br): account_br.grouped_ledger_lines = {} if not account_br.ledger_lines: @@ -87,8 +87,8 @@ class PartnersOpenInvoicesWebkit(report_sxw.rml_parse, CommonPartnersReportHeade plane_lines.sort(key=itemgetter('currency_code')) for curr, lines in groupby(plane_lines, key=itemgetter('currency_code')): tmp = [x for x in lines] - account_br.grouped_ledger_lines[part_id].append((curr, tmp)) #I want to reiter many times - + account_br.grouped_ledger_lines[part_id].append((curr, tmp)) # I want to reiter many times + def set_context(self, objects, data, ids, report_type=None): """Populate a ledger_lines attribute on each browse record that will be used by mako template""" diff --git a/account_financial_report_webkit/report/partner_balance.py b/account_financial_report_webkit/report/partner_balance.py index 3c760764..6034f36c 100644 --- a/account_financial_report_webkit/report/partner_balance.py +++ b/account_financial_report_webkit/report/partner_balance.py @@ -20,13 +20,13 @@ ############################################################################## -from report import report_sxw -from tools.translate import _ -import pooler from datetime import datetime -from common_partner_balance_reports import CommonPartnerBalanceReportHeaderWebkit -from webkit_parser_header_fix import HeaderFooterTextWebKitParser +from openerp import pooler +from openerp.report import report_sxw +from openerp.tools.translate import _ +from .common_partner_balance_reports import CommonPartnerBalanceReportHeaderWebkit +from .webkit_parser_header_fix import HeaderFooterTextWebKitParser class PartnerBalanceWebkit(report_sxw.rml_parse, CommonPartnerBalanceReportHeaderWebkit): @@ -35,7 +35,7 @@ class PartnerBalanceWebkit(report_sxw.rml_parse, CommonPartnerBalanceReportHeade super(PartnerBalanceWebkit, self).__init__(cursor, uid, name, context=context) self.pool = pooler.get_pool(self.cr.dbname) self.cursor = self.cr - + company = self.pool.get('res.users').browse(self.cr, uid, uid, context=context).company_id header_report_name = ' - '.join((_('PARTNER BALANCE'), company.name, company.currency_id.name)) diff --git a/account_financial_report_webkit/report/partners_ledger.py b/account_financial_report_webkit/report/partners_ledger.py index ea261be5..20fed48e 100644 --- a/account_financial_report_webkit/report/partners_ledger.py +++ b/account_financial_report_webkit/report/partners_ledger.py @@ -18,16 +18,16 @@ # along with this program. If not, see . # ############################################################################## -import pooler from collections import defaultdict -from report import report_sxw -from osv import osv -from tools.translate import _ from datetime import datetime -from common_partner_reports import CommonPartnersReportHeaderWebkit -from webkit_parser_header_fix import HeaderFooterTextWebKitParser +from openerp import pooler +from openerp.osv import osv +from openerp.report import report_sxw +from openerp.tools.translate import _ +from .common_partner_reports import CommonPartnersReportHeaderWebkit +from .webkit_parser_header_fix import HeaderFooterTextWebKitParser class PartnersLedgerWebkit(report_sxw.rml_parse, CommonPartnersReportHeaderWebkit): @@ -45,7 +45,7 @@ class PartnersLedgerWebkit(report_sxw.rml_parse, CommonPartnersReportHeaderWebki self.localcontext.update({ 'cr': cursor, 'uid': uid, - 'report_name':_('Partner Ledger'), + 'report_name': _('Partner Ledger'), 'display_account_raw': self._get_display_account_raw, 'filter_form': self._get_filter, 'target_move': self._get_target_move, diff --git a/account_financial_report_webkit/report/trial_balance.py b/account_financial_report_webkit/report/trial_balance.py index c596f080..db62d54f 100644 --- a/account_financial_report_webkit/report/trial_balance.py +++ b/account_financial_report_webkit/report/trial_balance.py @@ -20,24 +20,26 @@ ############################################################################## -from report import report_sxw -from tools.translate import _ -import pooler from datetime import datetime -from common_balance_reports import CommonBalanceReportHeaderWebkit -from webkit_parser_header_fix import HeaderFooterTextWebKitParser +from openerp import pooler +from openerp.report import report_sxw +from openerp.tools.translate import _ +from .common_balance_reports import CommonBalanceReportHeaderWebkit +from .webkit_parser_header_fix import HeaderFooterTextWebKitParser + def sign(number): return cmp(number, 0) + class TrialBalanceWebkit(report_sxw.rml_parse, CommonBalanceReportHeaderWebkit): def __init__(self, cursor, uid, name, context): super(TrialBalanceWebkit, self).__init__(cursor, uid, name, context=context) self.pool = pooler.get_pool(self.cr.dbname) self.cursor = self.cr - + company = self.pool.get('res.users').browse(self.cr, uid, uid, context=context).company_id header_report_name = ' - '.join((_('TRIAL BALANCE'), company.name, company.currency_id.name)) 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 c84166c5..0a1e37c3 100644 --- a/account_financial_report_webkit/report/webkit_parser_header_fix.py +++ b/account_financial_report_webkit/report/webkit_parser_header_fix.py @@ -37,8 +37,8 @@ import logging from mako import exceptions -from osv.osv import except_osv -from tools.translate import _ +from openerp.osv.osv import except_osv +from openerp.tools.translate import _ from openerp import addons from openerp.addons.report_webkit import webkit_report from openerp.addons.report_webkit.webkit_report import mako_template @@ -232,4 +232,3 @@ class HeaderFooterTextWebKitParser(webkit_report.WebKitParser): bin = self.get_lib(cursor, uid) pdf = self.generate_pdf(bin, report_xml, head, foot, htmls) return (pdf, 'pdf') - diff --git a/account_financial_report_webkit/wizard/balance_common.py b/account_financial_report_webkit/wizard/balance_common.py index 099566fe..fb7c1e9d 100644 --- a/account_financial_report_webkit/wizard/balance_common.py +++ b/account_financial_report_webkit/wizard/balance_common.py @@ -30,10 +30,11 @@ import time -from osv import fields, osv from lxml import etree -from tools.translate import _ from datetime import datetime +from openerp.osv import fields, orm +from openerp.tools.translate import _ + def previous_year_date(date, nb_prev=1): if not date: @@ -44,7 +45,8 @@ def previous_year_date(date, nb_prev=1): day=parsed_date.day) return previous_date -class AccountBalanceCommonWizard(osv.osv_memory): + +class AccountBalanceCommonWizard(orm.TransientModel): """Will launch trial balance report and pass required args""" _inherit = "account.common.account.report" @@ -54,7 +56,7 @@ class AccountBalanceCommonWizard(osv.osv_memory): # an update module should be done if changed # in order to create fields in db COMPARISON_LEVEL = 3 - + COMPARE_SELECTION = [('filter_no', 'No Comparison'), ('filter_year', 'Fiscal Year'), ('filter_date', 'Date'), @@ -63,7 +65,7 @@ class AccountBalanceCommonWizard(osv.osv_memory): M2O_DYNAMIC_FIELDS = [f % index for f in ["comp%s_fiscalyear_id", "comp%s_period_from", - "comp%s_period_to",] + "comp%s_period_to"] for index in range(COMPARISON_LEVEL)] SIMPLE_DYNAMIC_FIELDS = [f % index for f in ["comp%s_filter", "comp%s_date_from", @@ -83,17 +85,21 @@ class AccountBalanceCommonWizard(osv.osv_memory): 'filter': fields.selection([('filter_no', 'No Filters'), ('filter_date', 'Date'), ('filter_period', 'Periods'), - ('filter_opening', 'Opening Only')], "Filter by", required=True, help='Filter by date : no opening balance will be displayed. (opening balance can only be calculated based on period to be correct).'), + ('filter_opening', 'Opening Only')], + "Filter by", + required=True, + help='Filter by date : no opening balance will be displayed. ' + '(opening balance can only be calculated based on period to be correct).'), } for index in range(COMPARISON_LEVEL): _columns.update( - {"comp%s_filter" % (index,): fields.selection(COMPARE_SELECTION, string='Compare By', required=True), - "comp%s_fiscalyear_id" % (index,): fields.many2one('account.fiscalyear', 'Fiscal Year'), - "comp%s_period_from" % (index,): fields.many2one('account.period', 'Start Period'), - "comp%s_period_to" % (index,): fields.many2one('account.period', 'End Period'), - "comp%s_date_from" % (index,): fields.date("Start Date"), - "comp%s_date_to" % (index,): fields.date("End Date"),}) + {"comp%s_filter" % index: fields.selection(COMPARE_SELECTION, string='Compare By', required=True), + "comp%s_fiscalyear_id" % index: fields.many2one('account.fiscalyear', 'Fiscal Year'), + "comp%s_period_from" % index: fields.many2one('account.period', 'Start Period'), + "comp%s_period_to" % index: fields.many2one('account.period', 'End Period'), + "comp%s_date_from" % index: fields.date("Start Date"), + "comp%s_date_to" % index: fields.date("End Date")}) _defaults = { 'account_ids': _get_account_ids, @@ -141,9 +147,13 @@ class AccountBalanceCommonWizard(osv.osv_memory): if placeholder: placeholder = placeholder[0] for index in range(self.COMPARISON_LEVEL): - page = etree.Element('page', {'name': "comp%s" % (index,), 'string': _("Comparison %s") % (index+1,)}) + page = etree.Element( + 'page', + {'name': "comp%s" % index, + 'string': _("Comparison %s") % (index + 1, )}) group = etree.Element('group') page.append(group) + def modifiers_and_append(elem): orm.setup_modifiers(elem) group.append(elem) @@ -159,7 +169,6 @@ class AccountBalanceCommonWizard(osv.osv_memory): "{'required': [('comp%(index)s_filter','in',('filter_year','filter_opening'))]," \ " 'invisible': [('comp%(index)s_filter','not in',('filter_year','filter_opening'))]}" % {'index': index}})) - dates_attrs = "{'required': [('comp%(index)s_filter','=','filter_date')], " \ " 'invisible': [('comp%(index)s_filter','!=','filter_date')]}" % {'index': index} modifiers_and_append(etree.Element( @@ -203,7 +212,7 @@ class AccountBalanceCommonWizard(osv.osv_memory): def onchange_filter(self, cr, uid, ids, filter='filter_no', fiscalyear_id=False, context=None): res = {} if filter == 'filter_no': - res['value'] = {'period_from': False, 'period_to': False, 'date_from': False ,'date_to': False} + res['value'] = {'period_from': False, 'period_to': False, 'date_from': False, 'date_to': False} if filter == 'filter_date': if fiscalyear_id: fyear = self.pool.get('account.fiscalyear').browse(cr, uid, fiscalyear_id, context=context) @@ -231,7 +240,7 @@ class AccountBalanceCommonWizard(osv.osv_memory): AND COALESCE(p.special, FALSE) = FALSE ORDER BY p.date_stop DESC LIMIT 1) AS period_stop''', (fiscalyear_id, fiscalyear_id)) - periods = [i[0] for i in cr.fetchall()] + periods = [i[0] for i in cr.fetchall()] if periods: start_period = end_period = periods[0] if len(periods) > 1: @@ -258,15 +267,28 @@ class AccountBalanceCommonWizard(osv.osv_memory): date_to_field = "comp%s_date_to" % (index,) if comp_filter == 'filter_no': - res['value'] = {fy_id_field: False, period_from_field: False, period_to_field: False, date_from_field: False ,date_to_field: False} + res['value'] = { + fy_id_field: False, + period_from_field: False, + period_to_field: False, + date_from_field: False, + date_to_field: False + } if comp_filter in ('filter_year', 'filter_opening'): - res['value'] = {fy_id_field: last_fiscalyear_id, period_from_field: False, period_to_field: False, date_from_field: False ,date_to_field: False} + res['value'] = { + fy_id_field: last_fiscalyear_id, + period_from_field: False, + period_to_field: False, + date_from_field: False, + date_to_field: False + } if comp_filter == 'filter_date': dates = {} if main_filter == 'filter_date': dates = { 'date_start': previous_year_date(start_date, index + 1).strftime('%Y-%m-%d'), - 'date_stop': previous_year_date(stop_date, index + 1).strftime('%Y-%m-%d'),} + 'date_stop': previous_year_date(stop_date, index + 1).strftime('%Y-%m-%d'), + } elif last_fiscalyear_id: dates = fy_obj.read(cr, uid, last_fiscalyear_id, ['date_start', 'date_stop'], context=context) @@ -290,7 +312,7 @@ class AccountBalanceCommonWizard(osv.osv_memory): AND COALESCE(p.special, FALSE) = FALSE ORDER BY p.date_stop DESC LIMIT 1) AS period_stop''', {'fiscalyear': last_fiscalyear_id}) - periods = [i[0] for i in cr.fetchall()] + periods = [i[0] for i in cr.fetchall()] if periods and len(periods) > 1: start_period = end_period = periods[0] if len(periods) > 1: @@ -311,7 +333,7 @@ class AccountBalanceCommonWizard(osv.osv_memory): # will be used to attach the report on the main account data['ids'] = [data['form']['chart_account_id']] - fields_to_read = ['account_ids',] + fields_to_read = ['account_ids', ] fields_to_read += self.DYNAMIC_FIELDS vals = self.read(cr, uid, ids, fields_to_read, context=context)[0] @@ -323,5 +345,3 @@ class AccountBalanceCommonWizard(osv.osv_memory): vals['max_comparison'] = self.COMPARISON_LEVEL data['form'].update(vals) return data - -AccountBalanceCommonWizard() diff --git a/account_financial_report_webkit/wizard/general_ledger_wizard.py b/account_financial_report_webkit/wizard/general_ledger_wizard.py index 863c1d98..79766563 100644 --- a/account_financial_report_webkit/wizard/general_ledger_wizard.py +++ b/account_financial_report_webkit/wizard/general_ledger_wizard.py @@ -21,12 +21,11 @@ import time -from osv import fields, osv +from openerp.osv import fields, orm -class AccountReportGeneralLedgerWizard(osv.osv_memory): - """Will launch general ledger report and pass requiered args""" - +class AccountReportGeneralLedgerWizard(orm.TransientModel): + """Will launch general ledger report and pass required args""" _inherit = "account.common.account.report" _name = "general.ledger.webkit" @@ -69,11 +68,9 @@ class AccountReportGeneralLedgerWizard(osv.osv_memory): def pre_print_report(self, cr, uid, ids, data, context=None): data = super(AccountReportGeneralLedgerWizard, self).pre_print_report(cr, uid, ids, data, context) - if context is None: - context = {} # will be used to attach the report on the main account data['ids'] = [data['form']['chart_account_id']] - vals = self.read(cr, uid, ids, + vals = self.read(cr, uid, ids, ['amount_currency', 'display_account', 'account_ids', @@ -85,7 +82,12 @@ class AccountReportGeneralLedgerWizard(osv.osv_memory): def onchange_filter(self, cr, uid, ids, filter='filter_no', fiscalyear_id=False, context=None): res = {} if filter == 'filter_no': - res['value'] = {'period_from': False, 'period_to': False, 'date_from': False ,'date_to': False} + res['value'] = { + 'period_from': False, + 'period_to': False, + 'date_from': False, + 'date_to': False, + } if filter == 'filter_date': if fiscalyear_id: fyear = self.pool.get('account.fiscalyear').browse(cr, uid, fiscalyear_id, context=context) @@ -93,7 +95,12 @@ class AccountReportGeneralLedgerWizard(osv.osv_memory): date_to = fyear.date_stop > time.strftime('%Y-%m-%d') and time.strftime('%Y-%m-%d') or fyear.date_stop else: date_from, date_to = time.strftime('%Y-01-01'), time.strftime('%Y-%m-%d') - res['value'] = {'period_from': False, 'period_to': False, 'date_from': date_from, 'date_to': date_to} + res['value'] = { + 'period_from': False, + 'period_to': False, + 'date_from': date_from, + 'date_to': date_to + } if filter == 'filter_period' and fiscalyear_id: start_period = end_period = False cr.execute(''' @@ -113,7 +120,7 @@ class AccountReportGeneralLedgerWizard(osv.osv_memory): AND COALESCE(p.special, FALSE) = FALSE ORDER BY p.date_stop DESC LIMIT 1) AS period_stop''', (fiscalyear_id, fiscalyear_id)) - periods = [i[0] for i in cr.fetchall()] + periods = [i[0] for i in cr.fetchall()] if periods: start_period = end_period = periods[0] if len(periods) > 1: @@ -122,11 +129,8 @@ class AccountReportGeneralLedgerWizard(osv.osv_memory): return res def _print_report(self, cursor, uid, ids, data, context=None): - context = context or {} # we update form with display account value data = self.pre_print_report(cursor, uid, ids, data, context=context) return {'type': 'ir.actions.report.xml', 'report_name': 'account.account_report_general_ledger_webkit', 'datas': data} - -AccountReportGeneralLedgerWizard() diff --git a/account_financial_report_webkit/wizard/open_invoices_wizard.py b/account_financial_report_webkit/wizard/open_invoices_wizard.py index 30284a19..4e18a8b7 100644 --- a/account_financial_report_webkit/wizard/open_invoices_wizard.py +++ b/account_financial_report_webkit/wizard/open_invoices_wizard.py @@ -18,10 +18,10 @@ # along with this program. If not, see . # ############################################################################## -from osv import fields, osv +from openerp.osv import fields, orm -class AccountReportOpenInvoicesWizard(osv.osv_memory): +class AccountReportOpenInvoicesWizard(orm.TransientModel): """Will launch partner ledger report and pass required args""" _inherit = "partners.ledger.webkit" @@ -29,7 +29,7 @@ class AccountReportOpenInvoicesWizard(osv.osv_memory): _description = "Open Invoices Report" _columns = { - 'group_by_currency':fields.boolean('Group Partner by currency'), + 'group_by_currency': fields.boolean('Group Partner by currency'), 'until_date': fields.date("Clearance date", required=True, help="""The clearance date is essentially a tool used for debtors provisionning calculation. @@ -57,38 +57,38 @@ By amending the clearance date, you will be, for instance, able to answer the qu (_check_until_date, 'Clearance date must be the very last date of the last period or later.', ['until_date']), ] - def default_until_date(self, cursor, uid, ids, fiscalyear_id=False, period_id=False, date_to=False, context=None): + def default_until_date(self, cr, uid, ids, fiscalyear_id=False, period_id=False, date_to=False, context=None): res_date = False # first priority: period or date filters if period_id: - res_date = self.pool.get('account.period').read(cursor, uid, period_id, ['date_stop'], context=context)['date_stop'] + res_date = self.pool.get('account.period').read(cr, uid, period_id, ['date_stop'], context=context)['date_stop'] elif date_to: res_date = date_to elif fiscalyear_id: - res_date = self.pool.get('account.fiscalyear').read(cursor, uid, fiscalyear_id, ['date_stop'], context=context)['date_stop'] + res_date = self.pool.get('account.fiscalyear').read(cr, uid, fiscalyear_id, ['date_stop'], context=context)['date_stop'] return res_date - def onchange_fiscalyear(self, cursor, uid, ids, fiscalyear=False, period_id=False, date_to=False, until_date=False, context=None): + def onchange_fiscalyear(self, cr, uid, ids, fiscalyear=False, period_id=False, date_to=False, until_date=False, context=None): res = {'value': {}} - res['value']['until_date'] = self.default_until_date(cursor, uid, ids, + res['value']['until_date'] = self.default_until_date(cr, uid, ids, fiscalyear_id=fiscalyear, period_id=period_id, date_to=date_to, context=context) return res - def onchange_date_to(self, cursor, uid, ids, fiscalyear=False, period_id=False, date_to=False, until_date=False, context=None): + def onchange_date_to(self, cr, uid, ids, fiscalyear=False, period_id=False, date_to=False, until_date=False, context=None): res = {'value': {}} - res['value']['until_date'] = self.default_until_date(cursor, uid, ids, + res['value']['until_date'] = self.default_until_date(cr, uid, ids, fiscalyear_id=fiscalyear, period_id=period_id, date_to=date_to, context=context) return res - def onchange_period_to(self, cursor, uid, ids, fiscalyear=False, period_id=False, date_to=False, until_date=False, context=None): + def onchange_period_to(self, cr, uid, ids, fiscalyear=False, period_id=False, date_to=False, until_date=False, context=None): res = {'value': {}} - res['value']['until_date'] = self.default_until_date(cursor, uid, ids, + res['value']['until_date'] = self.default_until_date(cr, uid, ids, fiscalyear_id=fiscalyear, period_id=period_id, date_to=date_to, @@ -107,20 +107,15 @@ By amending the clearance date, you will be, for instance, able to answer the qu def pre_print_report(self, cr, uid, ids, data, context=None): data = super(AccountReportOpenInvoicesWizard, self).pre_print_report(cr, uid, ids, data, context) - if context is None: - context = {} vals = self.read(cr, uid, ids, ['until_date', 'group_by_currency'], context=context)[0] data['form'].update(vals) return data - def _print_report(self, cursor, uid, ids, data, context=None): - context = context or {} + def _print_report(self, cr, uid, ids, data, context=None): # we update form with display account value - data = self.pre_print_report(cursor, uid, ids, data, context=context) + data = self.pre_print_report(cr, uid, ids, data, context=context) return {'type': 'ir.actions.report.xml', 'report_name': 'account.account_report_open_invoices_webkit', 'datas': data} - -AccountReportOpenInvoicesWizard() diff --git a/account_financial_report_webkit/wizard/partner_balance_wizard.py b/account_financial_report_webkit/wizard/partner_balance_wizard.py index fb2964b1..755278d8 100644 --- a/account_financial_report_webkit/wizard/partner_balance_wizard.py +++ b/account_financial_report_webkit/wizard/partner_balance_wizard.py @@ -19,10 +19,10 @@ # ############################################################################## -from osv import fields, osv +from openerp.osv import fields, orm -class AccountPartnerBalanceWizard(osv.osv_memory): +class AccountPartnerBalanceWizard(orm.TransientModel): """Will launch partner balance report and pass required args""" _inherit = "account.common.balance.report" @@ -30,9 +30,9 @@ class AccountPartnerBalanceWizard(osv.osv_memory): _description = "Partner Balance Report" _columns = { - 'result_selection': fields.selection([('customer','Receivable Accounts'), - ('supplier','Payable Accounts'), - ('customer_supplier','Receivable and Payable Accounts')], + 'result_selection': fields.selection([('customer', 'Receivable Accounts'), + ('supplier', 'Payable Accounts'), + ('customer_supplier', 'Receivable and Payable Accounts')], "Partner's", required=True), 'partner_ids': fields.many2many('res.partner', string='Filter on partner', help="Only selected partners will be printed. Leave empty to print all partners."), @@ -44,8 +44,6 @@ class AccountPartnerBalanceWizard(osv.osv_memory): def pre_print_report(self, cr, uid, ids, data, context=None): data = super(AccountPartnerBalanceWizard, self).pre_print_report(cr, uid, ids, data, context) - if context is None: - context = {} vals = self.read(cr, uid, ids, ['result_selection', 'partner_ids'], context=context)[0] @@ -53,12 +51,9 @@ class AccountPartnerBalanceWizard(osv.osv_memory): return data def _print_report(self, cursor, uid, ids, data, context=None): - context = context or {} # we update form with display account value data = self.pre_print_report(cursor, uid, ids, data, context=context) return {'type': 'ir.actions.report.xml', 'report_name': 'account.account_report_partner_balance_webkit', 'datas': data} - -AccountPartnerBalanceWizard() diff --git a/account_financial_report_webkit/wizard/partners_ledger_wizard.py b/account_financial_report_webkit/wizard/partners_ledger_wizard.py index e8af5c5d..46e59a63 100644 --- a/account_financial_report_webkit/wizard/partners_ledger_wizard.py +++ b/account_financial_report_webkit/wizard/partners_ledger_wizard.py @@ -20,10 +20,10 @@ ############################################################################## import time -from osv import fields, osv +from openerp.osv import fields, orm -class AccountReportPartnersLedgerWizard(osv.osv_memory): +class AccountReportPartnersLedgerWizard(orm.TransientModel): """Will launch partner ledger report and pass required args""" _inherit = "account.common.partner.report" @@ -57,7 +57,8 @@ class AccountReportPartnersLedgerWizard(osv.osv_memory): def onchange_filter(self, cr, uid, ids, filter='filter_no', fiscalyear_id=False, context=None): res = {} if filter == 'filter_no': - res['value'] = {'period_from': False, 'period_to': False, 'date_from': False ,'date_to': False} + res['value'] = {'period_from': False, 'period_to': False, 'date_from': False, 'date_to': False} + if filter == 'filter_date': if fiscalyear_id: fyear = self.pool.get('account.fiscalyear').browse(cr, uid, fiscalyear_id, context=context) @@ -85,7 +86,7 @@ class AccountReportPartnersLedgerWizard(osv.osv_memory): AND COALESCE(p.special, FALSE) = FALSE ORDER BY p.date_stop DESC LIMIT 1) AS period_stop''', (fiscalyear_id, fiscalyear_id)) - periods = [i[0] for i in cr.fetchall()] + periods = [i[0] for i in cr.fetchall()] if periods: start_period = end_period = periods[0] if len(periods) > 1: @@ -100,17 +101,14 @@ class AccountReportPartnersLedgerWizard(osv.osv_memory): # will be used to attach the report on the main account data['ids'] = [data['form']['chart_account_id']] vals = self.read(cr, uid, ids, - ['amount_currency', 'partner_ids',], + ['amount_currency', 'partner_ids'], context=context)[0] data['form'].update(vals) return data def _print_report(self, cursor, uid, ids, data, context=None): - context = context or {} # we update form with display account value data = self.pre_print_report(cursor, uid, ids, data, context=context) return {'type': 'ir.actions.report.xml', 'report_name': 'account.account_report_partners_ledger_webkit', 'datas': data} - -AccountReportPartnersLedgerWizard() From 4fa4cf8b1ca147bf4b890a4dc39df368caedb579 Mon Sep 17 00:00:00 2001 From: "Guewen Baconnier @ Camptocamp" Date: Wed, 12 Dec 2012 07:47:12 +0100 Subject: [PATCH 08/16] [FIX] views of partners reports wizards --- .../wizard/open_invoices_wizard_view.xml | 1 + .../wizard/partner_balance_wizard_view.xml | 3 ++- .../wizard/partners_ledger_wizard_view.xml | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/account_financial_report_webkit/wizard/open_invoices_wizard_view.xml b/account_financial_report_webkit/wizard/open_invoices_wizard_view.xml index cf8205dd..48cf0721 100644 --- a/account_financial_report_webkit/wizard/open_invoices_wizard_view.xml +++ b/account_financial_report_webkit/wizard/open_invoices_wizard_view.xml @@ -16,6 +16,7 @@ 4 + diff --git a/account_financial_report_webkit/wizard/partner_balance_wizard_view.xml b/account_financial_report_webkit/wizard/partner_balance_wizard_view.xml index 55a04292..24b5be02 100644 --- a/account_financial_report_webkit/wizard/partner_balance_wizard_view.xml +++ b/account_financial_report_webkit/wizard/partner_balance_wizard_view.xml @@ -20,6 +20,7 @@ 4 + @@ -37,7 +38,7 @@ - + diff --git a/account_financial_report_webkit/wizard/partners_ledger_wizard_view.xml b/account_financial_report_webkit/wizard/partners_ledger_wizard_view.xml index 88d4f948..204ec02f 100644 --- a/account_financial_report_webkit/wizard/partners_ledger_wizard_view.xml +++ b/account_financial_report_webkit/wizard/partners_ledger_wizard_view.xml @@ -16,6 +16,7 @@ 4 + From d9045d441a813d1d6ebbcc266c88c086e592afcf Mon Sep 17 00:00:00 2001 From: "Guewen Baconnier @ Camptocamp" Date: Wed, 12 Dec 2012 07:52:56 +0100 Subject: [PATCH 09/16] [DEL] remove the profit & loss report which is actually dead code --- .../__openerp__.py | 1 - .../report/__init__.py | 1 - .../report/profit_loss.py | 115 ------------ .../report/report.xml | 14 -- .../wizard/__init__.py | 1 - .../wizard/balance_common_view.xml | 2 +- .../wizard/partner_balance_wizard_view.xml | 2 +- .../wizard/profit_loss_wizard.py | 166 ------------------ .../wizard/profit_loss_wizard_view.xml | 71 -------- .../wizard/trial_balance_wizard_view.xml | 2 +- 10 files changed, 3 insertions(+), 372 deletions(-) delete mode 100644 account_financial_report_webkit/report/profit_loss.py delete mode 100644 account_financial_report_webkit/wizard/profit_loss_wizard.py delete mode 100644 account_financial_report_webkit/wizard/profit_loss_wizard_view.xml diff --git a/account_financial_report_webkit/__openerp__.py b/account_financial_report_webkit/__openerp__.py index 5b21d08d..6a3e648c 100644 --- a/account_financial_report_webkit/__openerp__.py +++ b/account_financial_report_webkit/__openerp__.py @@ -117,7 +117,6 @@ wkhtmltopdf. The texts are defined inside the report classes. 'wizard/partner_balance_wizard_view.xml', 'wizard/open_invoices_wizard_view.xml', 'report_menus.xml', -# 'wizard/profit_loss_wizard_view.xml', ], # tests order matter 'test': ['tests/general_ledger.yml', diff --git a/account_financial_report_webkit/report/__init__.py b/account_financial_report_webkit/report/__init__.py index d7d7cf9a..0934d98f 100644 --- a/account_financial_report_webkit/report/__init__.py +++ b/account_financial_report_webkit/report/__init__.py @@ -8,4 +8,3 @@ from . import webkit_parser_header_fix from . import trial_balance from . import partner_balance from . import open_invoices -#from . import account_report_profit_loss diff --git a/account_financial_report_webkit/report/profit_loss.py b/account_financial_report_webkit/report/profit_loss.py deleted file mode 100644 index d53362e0..00000000 --- a/account_financial_report_webkit/report/profit_loss.py +++ /dev/null @@ -1,115 +0,0 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# Author: Guewen Baconnier -# Copyright Camptocamp SA 2011 -# -# 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 . -# -############################################################################## - -import pooler - -from report import report_sxw -from tools.translate import _ -from datetime import datetime -from common_balance_reports import CommonBalanceReportHeaderWebkit -from webkit_parser_header_fix import HeaderFooterTextWebKitParser - - -class ProfitLossWebkit(report_sxw.rml_parse, CommonBalanceReportHeaderWebkit): - - def __init__(self, cursor, uid, name, context): - super(ProfitLossWebkit, self).__init__(cursor, uid, name, context=context) - self.pool = pooler.get_pool(self.cr.dbname) - self.cursor = self.cr - - company = self.pool.get('res.users').browse(self.cr, uid, uid, context=context).company_id - header_report_name = ' - '.join((_('PROFIT AND LOSS'), company.name, company.currency_id.name)) - - footer_date_time = self.formatLang(str(datetime.today()), date_time=True) - - self.localcontext.update({ - 'cr': cursor, - 'uid': uid, - 'report_name': _('Profit and Loss'), - 'display_account': self._get_display_account, - 'display_account_raw': self._get_display_account_raw, - 'filter_form': self._get_filter, - 'target_move': self._get_target_move, - 'display_target_move': self._get_display_target_move, - 'accounts': self._get_accounts_br, - 'numbers_display': self._get_numbers_display, - 'level_print': self._get_level_print, - 'level_bold': self._get_level_bold, - 'level_italic': self._get_level_italic, - 'level_size': self._get_level_size, - 'level_underline': self._get_level_underline, - 'level_uppercase': self._get_level_uppercase, - 'additional_args': [ - ('--header-font-name', 'Helvetica'), - ('--footer-font-name', 'Helvetica'), - ('--header-font-size', '10'), - ('--footer-font-size', '6'), - ('--header-left', header_report_name), - ('--header-spacing', '2'), - ('--footer-left', footer_date_time), - ('--footer-right', ' '.join((_('Page'), '[page]', _('of'), '[topage]'))), - ('--footer-line',), - ], - }) - - def _get_level_print(self, data, level): - return self._get_form_param("level%s_print" % (level,), data) - - def _get_level_bold(self, data, level): - return self._get_form_param("level%s_bold" % (level,), data) - - def _get_level_italic(self, data, level): - return self._get_form_param("level%s_italic" % (level,), data) - - def _get_level_size(self, data, level): - return self._get_form_param("level%s_size" % (level,), data) - - def _get_level_underline(self, data, level): - return self._get_form_param("level%s_underline" % (level,), data) - - def _get_level_uppercase(self, data, level): - return self._get_form_param("level%s_uppercase" % (level,), data) - - def _update_levels(self, objects): - # start leveling from 0 - levels = [account['current']['level'] for account in objects] - min_level = min(levels) - - for account in objects: - account['current']['level'] -= min_level - return objects - - def set_context(self, objects, data, ids, report_type=None): - """Populate a ledger_lines attribute on each browse record that will be used - by mako template""" - objects, new_ids, context_report_values = self.compute_balance_data(data, filter_report_type=['expense', 'income']) - - objects = self._update_levels(objects) - - self.localcontext.update(context_report_values) - - return super(ProfitLossWebkit, self).set_context(objects, data, new_ids, - report_type=report_type) - -HeaderFooterTextWebKitParser('report.account.account_report_profit_loss_webkit', - 'account.account', - 'addons/account_financial_report_webkit/report/templates/account_report_profit_loss.mako', - parser=ProfitLossWebkit) diff --git a/account_financial_report_webkit/report/report.xml b/account_financial_report_webkit/report/report.xml index b540318a..a003e55f 100644 --- a/account_financial_report_webkit/report/report.xml +++ b/account_financial_report_webkit/report/report.xml @@ -111,19 +111,5 @@ - - - - - - - - - - - - - - diff --git a/account_financial_report_webkit/wizard/__init__.py b/account_financial_report_webkit/wizard/__init__.py index 9e184891..6d5a6f1b 100644 --- a/account_financial_report_webkit/wizard/__init__.py +++ b/account_financial_report_webkit/wizard/__init__.py @@ -24,4 +24,3 @@ from . import partners_ledger_wizard from . import trial_balance_wizard from . import partner_balance_wizard from . import open_invoices_wizard -#from . import account_report_profit_loss_wizard diff --git a/account_financial_report_webkit/wizard/balance_common_view.xml b/account_financial_report_webkit/wizard/balance_common_view.xml index dc3e4f04..b73ed8f4 100644 --- a/account_financial_report_webkit/wizard/balance_common_view.xml +++ b/account_financial_report_webkit/wizard/balance_common_view.xml @@ -4,7 +4,7 @@ diff --git a/account_financial_report_webkit/wizard/partner_balance_wizard_view.xml b/account_financial_report_webkit/wizard/partner_balance_wizard_view.xml index 24b5be02..7d3c0f0f 100644 --- a/account_financial_report_webkit/wizard/partner_balance_wizard_view.xml +++ b/account_financial_report_webkit/wizard/partner_balance_wizard_view.xml @@ -4,7 +4,7 @@ Partner Balance diff --git a/account_financial_report_webkit/wizard/profit_loss_wizard.py b/account_financial_report_webkit/wizard/profit_loss_wizard.py deleted file mode 100644 index 25d758d9..00000000 --- a/account_financial_report_webkit/wizard/profit_loss_wizard.py +++ /dev/null @@ -1,166 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# Copyright (c) 2011 Camptocamp SA (http://www.camptocamp.com) -# -# Author : Guewen Baconnier (Camptocamp) -# -# WARNING: This program as such is intended to be used by professional -# programmers who take the whole responsability of assessing all potential -# consequences resulting from its eventual inadequacies and bugs -# End users who are looking for a ready-to-use solution with commercial -# garantees and support are strongly adviced to contract a Free Software -# Service Company -# -# 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 2 -# 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, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -############################################################################## - -from lxml import etree -from tools.translate import _ -from osv import fields, osv - -LEVEL_STYLES = 6 - -DEFAULT_STYLES = { - 'print': [True, True, True, True, True, True], - 'size': [12, 11, 10, 9, 9, 9], - 'bold': [True, True, True, False, False, False], - 'italic': [False, False, False, False, False, False], - 'underline': [False, False, False, False, False, False], - 'uppercase': [True, True, False, False, False, False], -} - -class AccountProfitAndLossLedgerWizard(osv.osv_memory): - """Will launch trial balance report and pass required args""" - - _inherit = "account.common.balance.report" - _name = "profit.loss.webkit" - _description = "Profit and Loss Report" - - _columns = { - 'numbers_display': fields.selection([('normal', 'Normal'), ('round', 'Round (No decimal)'), ('kilo', 'Kilo')], 'Numbers Display', required=True) - } - - _defaults = { - 'numbers_display': 'normal', - } - - def view_init(self, cr, uid, fields_list, context=None): - """ - Creates view dynamically and adding fields at runtime. - @param self: The object pointer. - @param cr: A database cursor - @param uid: ID of the user currently logged in - @param context: A standard dictionary - @return: New arch of view with new columns. - """ - res = super(AccountProfitAndLossLedgerWizard, self).view_init(cr, uid, fields_list, context=context) - for index in range(LEVEL_STYLES): - # create columns for each comparison page - self._columns.update({ - "level%s_print" % (index,): - fields.boolean('Print'), - "level%s_size" % (index,): - fields.integer('Size', required=True), - "level%s_bold" % (index,): - fields.boolean('Bold'), - "level%s_italic" % (index,): - fields.boolean('Italic'), - "level%s_underline" % (index,): - fields.boolean('Underline'), - "level%s_uppercase" % (index,): - fields.boolean('Uppercase'), - }) - return res - - def default_get(self, cr, uid, fields, context=None): - """ - To get default values for the object. - - @param self: The object pointer. - @param cr: A database cursor - @param uid: ID of the user currently logged in - @param fields: List of fields for which we want default values - @param context: A standard dictionary - - @return: A dictionary which of fields with values. - - """ - res = super(AccountProfitAndLossLedgerWizard, self).default_get(cr, uid, fields, context=context) - - for key, values in DEFAULT_STYLES.iteritems(): - for index in range(LEVEL_STYLES): - field = "level%s_%s" % (index, key) - if not res.get(field, False): - res[field] = values[index] - return res - - def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False): - res = super(AccountProfitAndLossLedgerWizard, self).fields_view_get(cr, uid, view_id, view_type, context=context, toolbar=toolbar, submenu=submenu) - - eview = etree.fromstring(res['arch']) - placeholder = eview.xpath("//group[@name='levels']") - if placeholder: - placeholder = placeholder[0] - for index in range(LEVEL_STYLES): - # add fields - res['fields']["level%s_print" % (index,)] = {'string': "Print", 'type': 'boolean'} - res['fields']["level%s_size" % (index,)] = {'string': "Size", 'type': 'integer', 'required': True} - res['fields']["level%s_bold" % (index,)] = {'string': "Bold", 'type': 'boolean',} - res['fields']["level%s_italic" % (index,)] = {'string': "Italic", 'type': 'boolean',} - res['fields']["level%s_underline" % (index,)] = {'string': "Underline", 'type': 'boolean',} - res['fields']["level%s_uppercase" % (index,)] = {'string': "Uppercase", 'type': 'boolean'} - - common_attrs = "{'readonly': [('level%(index)s_print', '=', False)]}" % {'index': index} - group = etree.Element('group', {'name': "group_level_%s" % (index,), 'colspan':'4', 'col': '10'}) - group.append(etree.Element('separator', {'string': _('Level %s') % (index+1,), 'colspan':'2'})) - group.append(etree.Element('field', {'name': "level%s_print" % (index,), 'colspan': '8'})) - group.append(etree.Element('field', {'name': "level%s_size" % (index,), 'attrs': common_attrs})) - group.append(etree.Element('field', {'name': "level%s_bold" % (index,), 'attrs': common_attrs})) - group.append(etree.Element('field', {'name': "level%s_italic" % (index,), 'attrs': common_attrs})) - group.append(etree.Element('field', {'name': "level%s_underline" % (index,), 'attrs': common_attrs})) - group.append(etree.Element('field', {'name': "level%s_uppercase" % (index,), 'attrs': common_attrs})) - - placeholder.append(group) - res['arch'] = etree.tostring(eview) - return res - - def _print_report(self, cursor, uid, ids, data, context=None): - context = context or {} - # we update form with display account value - data = self.pre_print_report(cursor, uid, ids, data, context=context) - - fields_to_read = ['numbers_display',] - - # comparison fields - for index in range(LEVEL_STYLES): - fields_to_read.extend([ - "level%s_print" % (index,), - "level%s_size" % (index,), - "level%s_bold" % (index,), - "level%s_italic" % (index,), - "level%s_underline" % (index,), - "level%s_uppercase" % (index,), - ]) - - vals = self.read(cursor, uid, ids, fields_to_read,context=context)[0] - - data['form'].update(vals) - return {'type': 'ir.actions.report.xml', - 'report_name': 'account.account_report_profit_loss_webkit', - 'datas': data} - -AccountProfitAndLossLedgerWizard() diff --git a/account_financial_report_webkit/wizard/profit_loss_wizard_view.xml b/account_financial_report_webkit/wizard/profit_loss_wizard_view.xml deleted file mode 100644 index 08aa06d2..00000000 --- a/account_financial_report_webkit/wizard/profit_loss_wizard_view.xml +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - Profit and Loss Webkit - profit.loss.webkit - - - - - - - - 4 - - - - - - - - - - - - - - - - - - - - - True - - - - - - - Profit and Loss Webkit - ir.actions.act_window - profit.loss.webkit - form - form - - new - - - - - - - - - - - - - - - - - - - - - diff --git a/account_financial_report_webkit/wizard/trial_balance_wizard_view.xml b/account_financial_report_webkit/wizard/trial_balance_wizard_view.xml index fe91d25d..871f837a 100644 --- a/account_financial_report_webkit/wizard/trial_balance_wizard_view.xml +++ b/account_financial_report_webkit/wizard/trial_balance_wizard_view.xml @@ -4,7 +4,7 @@ Trial Balance From 6646dd0f9876098a37732be690e2a01dc098be53 Mon Sep 17 00:00:00 2001 From: "Guewen Baconnier @ Camptocamp" Date: Wed, 12 Dec 2012 08:10:56 +0100 Subject: [PATCH 10/16] [IMP] __openerp__ manifest: description to rst, set application, change name of the module --- .../__openerp__.py | 114 ++++++++++-------- 1 file changed, 64 insertions(+), 50 deletions(-) diff --git a/account_financial_report_webkit/__openerp__.py b/account_financial_report_webkit/__openerp__.py index 6a3e648c..035c25cc 100644 --- a/account_financial_report_webkit/__openerp__.py +++ b/account_financial_report_webkit/__openerp__.py @@ -18,12 +18,13 @@ # along with this program. If not, see . # ############################################################################## -# TODO refactor helper in order to act more like mixin -# By using properties we will have a more simple signature in fuctions { - 'name': 'Webkit based extended report financial report', + 'name': 'Financial Reports - Webkit', 'description': """ -This module replace the following standard openerp financial reports : +Financial Reports - Webkit +========================== + +This module replaces or adds the following standard OpenERP financial reports: - General ledger - Trial Balance (simple or comparative view) - Partner ledger @@ -32,50 +33,63 @@ This module replace the following standard openerp financial reports : Main improvements per report: +----------------------------- + +The General ledger: details of all entries posted in your books sorted by account. + +* Filter by account in the wizard (no need to go to the Chart of account to do this anymore) + or by view account (the report will display all regular children account) ie: you can select all P&L + accounts. +* The report will now print only account with movements OR with a balance not null. No more endless + report with accounts with no data. (field: display account is hidden) +* initial balance calculation on the fly if no open entry posted +* Thanks to a new checkbox in account form, you will have possibility to centralize any accounts you like. + Ie: you do not want to see all entries posted under the account ‘VAT on sales’; you will only see + aggregated amounts by periods. +* Counterpart account displayed for each transaction (3 accounts max.) to ease searching. +* Better ergonomy on the wizard: important information at the top, filters in the middle, options + at the bottom or separate tab, more specific filtering on a other tabs. No more unique wizard layout + for all financial reports (ie: we have removed the journal tab for the GL report) +* improved report style + +The partner ledger: details of entries relative to payable & receivable accounts posted in your books +sorted by account and partner. + +* Filter by partner now possible +* Now you can see accounts then Partner with subtotals for each account allowing you to check you data + with trial balance and partner balance for instance & accounts are ordered the same way than in the + Chart of account +* period have been added (date only is uncompleted since date can be outside period) +* Reconciliation code added +* subtotal by account +* alpha sorting (same in partner balance) + +Open invoice report : other version of the partner ledger showing unreconciled / partially reconcies entries - * The General ledger: details of all entries posted in your books sorted by account. - - Filter by account in the wizard (no need to go to the Chart of account to do this anymore) - or by view account (the report will display all regular children account) ie: you can select all P&L accounts. - - The report will now print only account with movements OR with a balance not null. No more endless - report with accounts with no data. (field: display account is hidden) - - initial balance calculation on the fly if no open entry posted - - Thanks to a new checkbox in account form, you will have possibility to centralize any accounts you like. - Ie: you do not want to see all entries posted under the account ‘VAT on sales’; you will only see aggregated amounts by periods. - - Counterpart account displayed for each transaction (3 accounts max.) to ease searching. - - Better ergonomy on the wizard: important information at the top, filters in the middle, options - at the bottom or separate tab, more specific filtering on a other tabs. No more unique wizard layout - for all financial reports (ie: we have removed the journal tab for the GL report) - - improved report style - - * The partner ledger: details of entries relative to payable & receivable accounts posted in your books sorted by account and partner. - - Filter by partner now possible - - Now you can see accounts then Partner with subtotals for each account allowing you to check you data - with trial balance and partner balance for instance & accounts are ordered the same way than in the Chart of account - - period have been added (date only is uncompleted since date can be outside period) - - Reconciliation code added - - subtotal by account - - alpha sorting (same in partner balance) - - * Open invoice report : other version of the partner ledger showing unreconciled / partially reconcies entries -(added on the 20/01/2012) - - Possibility to print unreconciled transactions only at any date in the past (thanks to the brand-new field: - last_rec_date which calculated the last move line reconciled date). No more pain to get open invoices at the last closing date. - - no initial balance calculated because the report shows open invoices from previous years. - - * The Trial balance: list of account with balances - - you can either see the column : Initial balance , debit, credit , end balance or compare balances over 4 periods of your choice - - You can select the filter opening to get the opening trial balance only - - If you create a extra virtual charts (using consolidated account) of account for your P&L and your balance sheet, - you can print your statutory accounts (with comparision over years for ex.) - - If you compare 2 periods, you will get differences in value and % also - - * The Partner balance: list of account with balances - - subtotal by account & partner - - alpha sorting (same in partner balance) +* Possibility to print unreconciled transactions only at any date in the past (thanks to the brand-new field: + `last_rec_date` which calculated the last move line reconciled date). No more pain to get open invoices at + the last closing date. +* no initial balance calculated because the report shows open invoices from previous years. + +The Trial balance: list of account with balances + +* you can either see the column : Initial balance , debit, credit , end balance or compare balances + over 4 periods of your choice +* You can select the filter opening to get the opening trial balance only +* If you create a extra virtual charts (using consolidated account) of account for your P&L + and your balance sheet, you can print your statutory accounts (with comparision over years for ex.) +* If you compare 2 periods, you will get differences in value and % also + +The Partner balance: list of account with balances + +* subtotal by account & partner +* alpha sorting (same in partner balance) Limitations: -In order to run properly this module make sure you have installed the librairie ‘wkhtmltopdf’ -for the pdf rendering (this library path must be added to you company settings). +------------ + +In order to run properly this module make sure you have installed the library `wkhtmltopdf` +for the pdf rendering (the library path must be set in a System Parameter `webkit_path`). Initial balances in these reports are based either on opening entry posted in the opening period or calculated on the fly. So make sure, @@ -86,15 +100,14 @@ date Vs IB by period) The opening period is assumed to be the 01.01 of the year with an opening flag and the first period of the year must starts also the 01.01 -Totals for amount in currencies are affective if the partner belong to +Totals for amount in currencies are effective if the partner belongs to an account with a secondary currency. html headers and footers are deactivated for these reports because of -an issue of wkhtmltopdf : -http://code.google.com/p/wkhtmltopdf/issues/detail?id=656 Instead, the -header and footer are created as text with arguments passed to +an issue in wkhtmltopdf: +http://code.google.com/p/wkhtmltopdf/issues/detail?id=656 +Instead, the header and footer are created as text with arguments passed to wkhtmltopdf. The texts are defined inside the report classes. - """, 'version': '1.0', 'author': 'Camptocamp', @@ -127,4 +140,5 @@ wkhtmltopdf. The texts are defined inside the report classes. #'tests/account_move_line.yml' 'active': False, 'installable': True, + 'application': True, } From 711dd3597dd4dcc7fc585d1594bd2a04d93d64a2 Mon Sep 17 00:00:00 2001 From: "Guewen Baconnier @ Camptocamp" Date: Wed, 12 Dec 2012 08:59:11 +0100 Subject: [PATCH 11/16] [ADD] license info in manifest --- account_financial_report_webkit/__openerp__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/account_financial_report_webkit/__openerp__.py b/account_financial_report_webkit/__openerp__.py index 035c25cc..54bcdf64 100644 --- a/account_financial_report_webkit/__openerp__.py +++ b/account_financial_report_webkit/__openerp__.py @@ -111,6 +111,7 @@ wkhtmltopdf. The texts are defined inside the report classes. """, 'version': '1.0', 'author': 'Camptocamp', + 'license': 'AGPL-3', 'category': 'Finance', 'website': 'http://www.camptocamp.com', 'images': [ From 20716cc4ec11d05f52d86436f0b894c538a5ed8e Mon Sep 17 00:00:00 2001 From: "Guewen Baconnier @ Camptocamp" Date: Wed, 12 Dec 2012 10:23:29 +0100 Subject: [PATCH 12/16] [ADD] module icon --- .../static/src/img/icon.png | Bin 0 -> 15230 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 account_financial_report_webkit/static/src/img/icon.png diff --git a/account_financial_report_webkit/static/src/img/icon.png b/account_financial_report_webkit/static/src/img/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..272d0294347c7c2fda3bc37cf726a9079c3f6313 GIT binary patch literal 15230 zcmd^l=U-IM(q~U(V8}T$1d*JP3`5R>1O-8I&PfCWnHh3U5)=g#K|o0Yf`Twa5kUb# zf=E^ok)Y(b{O0Lp4%0glezt|1sFS9ec86`qaO4jzoBiwe&*Sz`&~08Lj9 zPrZmBSM!L=7S0jg&I&F(YN{CJFvW8LzOEsTm@r=-zhK2M6`p^|RXp$i^IDt-^DmMR zZxx>ZQp(EM6r<@M5xFmtOBq=5-Eh8r?!{+9{90skY`FZjRRbnYrPe|5w4m7U2P|;%2VF{x^f1&jaVi`_EJX zikd;Ljv@X*7XJP||MsG(hkuBFu!nyDM$=ptbIsGw#s60Dzo?Ck74`jsLmd5_UG=q8 zc+UC7JUv|$Wu;^_WM!pgHD#nUB_*{b)wLybG&L{DNy%#I$m=L*{+n0J-}$Dmt6#{! zd0qZD@1_69`wtL&1I}mGat-nfb#>7R^7qC3%V0&%|E!Djf0Xy%ye|J)7n%RaD}Jtw z_&;I&Kf?U)SLfLIr~5ykJs|OoNu^w~|YB`F5g!5bhrbZUp)6>gl`Rp%WHj9~) z|NMKPt*wnu&N@3g3kwgYqob3Tm)FncaCLS2`*&L@jx(;+S}Tk#zc(;B=l;EvMnSvRqzXUSV0))g(4J45pF7+1mF} zDw4fxc*-DLsJgmF_73mj;$lNb-=|OG*DNhdpTB6XtO$Lfx4ypK-Q8{ZfXnNyWX)hc zr6jzn>CMi;acSw3?xrTEiVNih`S}kkA7noy5D3aR!NI}7>6xzw2M6y4Mn@;6WiIj$ zOfKyF{1tG|KqF2(K001UUS7z7!m5NTJv}}6sR2JTld=mnB?=Yn?w<9W;9V_imVsTL zU-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#i#po>RBPMOLt`9^QgEbv*>cy1y2Gv40uce$ZIe@HR)YMS#uTXH_^tCT*)o3^n F{udP(AcX(` literal 0 HcmV?d00001 From 46ca483969403e666f3f125da227c7700aed8fb4 Mon Sep 17 00:00:00 2001 From: "Guewen Baconnier @ Camptocamp" Date: Wed, 12 Dec 2012 11:04:19 +0100 Subject: [PATCH 13/16] [FIX] slight change in formulation --- account_financial_report_webkit/__openerp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/account_financial_report_webkit/__openerp__.py b/account_financial_report_webkit/__openerp__.py index 54bcdf64..924163a2 100644 --- a/account_financial_report_webkit/__openerp__.py +++ b/account_financial_report_webkit/__openerp__.py @@ -24,7 +24,7 @@ Financial Reports - Webkit ========================== -This module replaces or adds the following standard OpenERP financial reports: +This module adds or replaces the following standard OpenERP financial reports: - General ledger - Trial Balance (simple or comparative view) - Partner ledger From 38866dfe01563b67e21ed1b2d8ad66ca6819f6d9 Mon Sep 17 00:00:00 2001 From: "Alexandre Fayolle @ camptocamp" Date: Wed, 12 Dec 2012 11:24:35 +0100 Subject: [PATCH 14/16] [FIX] spell check and reformat the description of the addon --- .../__openerp__.py | 127 ++++++++++-------- 1 file changed, 72 insertions(+), 55 deletions(-) diff --git a/account_financial_report_webkit/__openerp__.py b/account_financial_report_webkit/__openerp__.py index 924163a2..27e83868 100644 --- a/account_financial_report_webkit/__openerp__.py +++ b/account_financial_report_webkit/__openerp__.py @@ -37,76 +37,93 @@ Main improvements per report: The General ledger: details of all entries posted in your books sorted by account. -* Filter by account in the wizard (no need to go to the Chart of account to do this anymore) - or by view account (the report will display all regular children account) ie: you can select all P&L - accounts. -* The report will now print only account with movements OR with a balance not null. No more endless - report with accounts with no data. (field: display account is hidden) +* Filter by account is available in the wizard (no need to go to the + Chart of Accounts to do this anymore) or by View account (the report + will display all regular children accounts) i.e. you can select all + P&L accounts. +* The report only prints accounts with moves OR with a non + null balance. No more endless report with empty accounts (field: + display account is hidden) * initial balance calculation on the fly if no open entry posted -* Thanks to a new checkbox in account form, you will have possibility to centralize any accounts you like. - Ie: you do not want to see all entries posted under the account ‘VAT on sales’; you will only see - aggregated amounts by periods. -* Counterpart account displayed for each transaction (3 accounts max.) to ease searching. -* Better ergonomy on the wizard: important information at the top, filters in the middle, options - at the bottom or separate tab, more specific filtering on a other tabs. No more unique wizard layout - for all financial reports (ie: we have removed the journal tab for the GL report) +* Thanks to a new checkbox in the account form, you will have the + possibility to centralize any account you like. This means you do + not want to see all entries posted under the account ‘VAT on sales’; + you will only see aggregated amounts by periods. +* Counterpart account is displayed for each transaction (3 accounts max.) + to ease searching. +* Better ergonomy on the wizard: important information is displayed in + the top part, filters are in the middle, and options are in the + bottom or on a separate tab. There is more specific filtering on + separate tabs. No more unique wizard layout for all financial + reports (we have removed the journal tab for the GL report) * improved report style -The partner ledger: details of entries relative to payable & receivable accounts posted in your books -sorted by account and partner. - -* Filter by partner now possible -* Now you can see accounts then Partner with subtotals for each account allowing you to check you data - with trial balance and partner balance for instance & accounts are ordered the same way than in the - Chart of account -* period have been added (date only is uncompleted since date can be outside period) +The partner ledger: details of entries relative to payable & +receivable accounts posted in your books sorted by account and +partner. + +* Filter by partner now available +* Now you can see Accounts then Partner with subtotals for each + account allowing you to check you data with trial balance and + partner balance for instance. Accounts are ordered in the same way as + in the Chart of account +* Period have been added (date only is not filled in since date can be + outside period) * Reconciliation code added -* subtotal by account -* alpha sorting (same in partner balance) - -Open invoice report : other version of the partner ledger showing unreconciled / partially reconcies entries - -* Possibility to print unreconciled transactions only at any date in the past (thanks to the brand-new field: - `last_rec_date` which calculated the last move line reconciled date). No more pain to get open invoices at - the last closing date. -* no initial balance calculated because the report shows open invoices from previous years. - -The Trial balance: list of account with balances - -* you can either see the column : Initial balance , debit, credit , end balance or compare balances - over 4 periods of your choice -* You can select the filter opening to get the opening trial balance only -* If you create a extra virtual charts (using consolidated account) of account for your P&L - and your balance sheet, you can print your statutory accounts (with comparision over years for ex.) -* If you compare 2 periods, you will get differences in value and % also +* Subtotal by account +* Alphabetical sorting (same as in partner balance) + +Open invoice report : other version of the partner ledger showing +unreconciled / partially reconciled entries. + +* Possibility to print unreconciled transactions only at any date in + the past (thanks to the new field: `last_rec_date` which computes + the last move line reconciliation date). No more pain to get open + invoices at the last closing date. +* no initial balance computed because the report shows open invoices + from previous years. + +The Trial balance: list of accounts with balances + +* You can either see the columns: initial balance, debit, credit, + end balance or compare balances over 4 periods of your choice +* You can select the "opening" filter to get the opening trial balance + only +* If you create an extra virtual chart (using consolidated account) of + accounts for your P&L and your balance sheet, you can print your + statutory accounts (with comparison over years for instance) +* If you compare 2 periods, you will get the differences in values and + in percent The Partner balance: list of account with balances -* subtotal by account & partner -* alpha sorting (same in partner balance) +* Subtotal by account and partner +* Alphabetical sorting (same as in partner balance) Limitations: ------------ -In order to run properly this module make sure you have installed the library `wkhtmltopdf` -for the pdf rendering (the library path must be set in a System Parameter `webkit_path`). +In order to run properly this module makes sure you have installed the +library `wkhtmltopdf` for the pdf rendering (the library path must be +set in a System Parameter `webkit_path`). Initial balances in these reports are based either on opening entry -posted in the opening period or calculated on the fly. So make sure, -your past accounting opening entries are in a opening period. -Initials balances are not calculated when using date filter (since a -date can be outside its logical period and IB could be different by -date Vs IB by period) The opening period is assumed to be the 01.01 of -the year with an opening flag and the first period of the year must -starts also the 01.01 - -Totals for amount in currencies are effective if the partner belongs to +posted in the opening period or calculated on the fly. So make sure +that your past accounting opening entries are in an opening period. +Initials balances are not computed when using the Date filter (since a +date can be outside its logical period and the initial balance could +be different when computed by data or by initial balance for the +period). The opening period is assumed to be the Jan. 1st of the year +with an opening flag and the first period of the year must start also +on Jan 1st. + +Totals for amounts in currencies are effective if the partner belongs to an account with a secondary currency. -html headers and footers are deactivated for these reports because of -an issue in wkhtmltopdf: -http://code.google.com/p/wkhtmltopdf/issues/detail?id=656 -Instead, the header and footer are created as text with arguments passed to +HTML headers and footers are deactivated for these reports because of +an issue in wkhtmltopdf +(http://code.google.com/p/wkhtmltopdf/issues/detail?id=656) Instead, +the header and footer are created as text with arguments passed to wkhtmltopdf. The texts are defined inside the report classes. """, 'version': '1.0', From f06fa1b6f17287117926466718a9e07869e9112d Mon Sep 17 00:00:00 2001 From: "Alexandre Fayolle @ camptocamp" Date: Wed, 12 Dec 2012 11:28:35 +0100 Subject: [PATCH 15/16] [REF] reformat list comprehension --- .../report/common_balance_reports.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/account_financial_report_webkit/report/common_balance_reports.py b/account_financial_report_webkit/report/common_balance_reports.py index 52e38a6c..7d0945a7 100644 --- a/account_financial_report_webkit/report/common_balance_reports.py +++ b/account_financial_report_webkit/report/common_balance_reports.py @@ -91,10 +91,9 @@ class CommonBalanceReportHeaderWebkit(CommonReportHeaderWebkit): # sum for top level views accounts child_ids = account_obj._get_children_and_consol(self.cursor, self.uid, account['id'], ctx) if child_ids: - child_init_balances = [ \ - init_bal['init_balance'] \ - for acnt_id, init_bal \ - in init_balance.iteritems() \ + child_init_balances = [ + init_bal['init_balance'] + for acnt_id, init_bal in init_balance.iteritems() if acnt_id in child_ids] top_init_balance = reduce(add, child_init_balances) account['init_balance'] = top_init_balance From 3dba319995f188c772774ba523fe4159345d4b12 Mon Sep 17 00:00:00 2001 From: "Alexandre Fayolle @ camptocamp" Date: Wed, 12 Dec 2012 11:36:14 +0100 Subject: [PATCH 16/16] [REF] account_financial_report_webkit: more reformatting --- .../__openerp__.py | 4 +- account_financial_report_webkit/account.py | 2 +- .../report/partners_ledger.py | 2 +- .../report/webkit_parser_header_fix.py | 38 +++++++++---------- .../wizard/balance_common.py | 6 +-- .../wizard/partners_ledger_wizard.py | 12 ++++-- 6 files changed, 35 insertions(+), 29 deletions(-) diff --git a/account_financial_report_webkit/__openerp__.py b/account_financial_report_webkit/__openerp__.py index 27e83868..b15ad080 100644 --- a/account_financial_report_webkit/__openerp__.py +++ b/account_financial_report_webkit/__openerp__.py @@ -44,7 +44,7 @@ The General ledger: details of all entries posted in your books sorted by accoun * The report only prints accounts with moves OR with a non null balance. No more endless report with empty accounts (field: display account is hidden) -* initial balance calculation on the fly if no open entry posted +* initial balance computation on the fly if no open entry posted * Thanks to a new checkbox in the account form, you will have the possibility to centralize any account you like. This means you do not want to see all entries posted under the account ‘VAT on sales’; @@ -108,7 +108,7 @@ library `wkhtmltopdf` for the pdf rendering (the library path must be set in a System Parameter `webkit_path`). Initial balances in these reports are based either on opening entry -posted in the opening period or calculated on the fly. So make sure +posted in the opening period or computed on the fly. So make sure that your past accounting opening entries are in an opening period. Initials balances are not computed when using the Date filter (since a date can be outside its logical period and the initial balance could diff --git a/account_financial_report_webkit/account.py b/account_financial_report_webkit/account.py index 1c82a993..97a63797 100644 --- a/account_financial_report_webkit/account.py +++ b/account_financial_report_webkit/account.py @@ -3,7 +3,7 @@ # # Copyright (c) 2011 Camptocamp SA (http://www.camptocamp.com) # -# Author : Guewen Baconnier (Camptocamp) +# Author: Guewen Baconnier (Camptocamp) # # WARNING: This program as such is intended to be used by professional # programmers who take the whole responsability of assessing all potential diff --git a/account_financial_report_webkit/report/partners_ledger.py b/account_financial_report_webkit/report/partners_ledger.py index 20fed48e..97284458 100644 --- a/account_financial_report_webkit/report/partners_ledger.py +++ b/account_financial_report_webkit/report/partners_ledger.py @@ -121,7 +121,7 @@ class PartnersLedgerWebkit(report_sxw.rml_parse, CommonPartnersReportHeaderWebki # when the opening period is included in the selected range of periods and # the opening period contains move lines, we must not compute the initial balance from previous periods # but only display the move lines of the opening period - # we identify them as : + # we identify them as: # - 'initial_balance' means compute the sums of move lines from previous periods # - 'opening_balance' means display the move lines of the opening period init_balance = main_filter in ('filter_no', 'filter_period') 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 0a1e37c3..7240604a 100644 --- a/account_financial_report_webkit/report/webkit_parser_header_fix.py +++ b/account_financial_report_webkit/report/webkit_parser_header_fix.py @@ -3,7 +3,7 @@ # # Copyright (c) 2011 Camptocamp SA (http://www.camptocamp.com) # -# Author : Guewen Baconnier (Camptocamp) +# Author: Guewen Baconnier (Camptocamp) # # WARNING: This program as such is intended to be used by professional # programmers who take the whole responsability of assessing all potential @@ -46,7 +46,7 @@ from openerp.addons.report_webkit.report_helper import WebKitHelper _logger = logging.getLogger('financial.reports.webkit') -# Class used only as a workaround to bug : +# Class used only as a workaround to bug: # http://code.google.com/p/wkhtmltopdf/issues/detail?id=656 # html headers and footers do not work on big files (hundreds of pages) so we replace them by @@ -54,7 +54,7 @@ _logger = logging.getLogger('financial.reports.webkit') # this class has to be removed once the bug is fixed # in your report class, to print headers and footers as text, you have to add them in the localcontext with a key 'additional_args' -# for instance : +# for instance: # header_report_name = _('PARTNER LEDGER') # footer_date_time = self.formatLang(str(datetime.today()), date_time=True) # self.localcontext.update({ @@ -89,17 +89,17 @@ class HeaderFooterTextWebKitParser(webkit_report.WebKitParser): # default to UTF-8 encoding. Use to override. command.extend(['--encoding', 'utf-8']) - if webkit_header.margin_top : + if webkit_header.margin_top: command.extend(['--margin-top', str(webkit_header.margin_top).replace(',', '.')]) - if webkit_header.margin_bottom : + if webkit_header.margin_bottom: command.extend(['--margin-bottom', str(webkit_header.margin_bottom).replace(',', '.')]) - if webkit_header.margin_left : + if webkit_header.margin_left: command.extend(['--margin-left', str(webkit_header.margin_left).replace(',', '.')]) - if webkit_header.margin_right : + if webkit_header.margin_right: command.extend(['--margin-right', str(webkit_header.margin_right).replace(',', '.')]) - if webkit_header.orientation : + if webkit_header.orientation: command.extend(['--orientation', str(webkit_header.orientation).replace(',', '.')]) - if webkit_header.format : + if webkit_header.format: command.extend(['--page-size', str(webkit_header.format).replace(',', '.')]) if self.parser_instance.localcontext.get('additional_args', False): @@ -107,7 +107,7 @@ class HeaderFooterTextWebKitParser(webkit_report.WebKitParser): command.extend(arg) count = 0 - for html in html_list : + for html in html_list: html_file = file(os.path.join(tmp_dir, str(time.time()) + str(count) +'.body.html'), 'w') count += 1 html_file.write(html) @@ -165,13 +165,13 @@ class HeaderFooterTextWebKitParser(webkit_report.WebKitParser): template = False - if report_xml.report_file : + if report_xml.report_file: path = addons.get_module_resource(*report_xml.report_file.split(os.path.sep)) - if os.path.exists(path) : + if os.path.exists(path): template = file(path).read() - if not template and report_xml.report_webkit_data : + if not template and report_xml.report_webkit_data: template = report_xml.report_webkit_data - if not template : + if not template: raise except_osv(_('Error!'), _('Webkit Report template not found !')) header = report_xml.webkit_header.html footer = report_xml.webkit_header.footer_html @@ -182,7 +182,7 @@ class HeaderFooterTextWebKitParser(webkit_report.WebKitParser): ) css = report_xml.webkit_header.css - if not css : + if not css: css = '' user = self.pool.get('res.users').browse(cursor, uid, uid) @@ -192,7 +192,7 @@ class HeaderFooterTextWebKitParser(webkit_report.WebKitParser): if report_xml.precise_mode: for obj in objs: self.parser_instance.localcontext['objects'] = [obj] - try : + try: html = body_mako_tpl.render(helper=helper, css=css, _=self.translate_call, @@ -203,7 +203,7 @@ class HeaderFooterTextWebKitParser(webkit_report.WebKitParser): _logger.error(msg) raise except_osv(_('Webkit render'), msg) else: - try : + try: html = body_mako_tpl.render(helper=helper, css=css, _=self.translate_call, @@ -217,8 +217,8 @@ class HeaderFooterTextWebKitParser(webkit_report.WebKitParser): # NO html footer and header because we write them as text with wkhtmltopdf head = foot = False - if report_xml.webkit_debug : - try : + if report_xml.webkit_debug: + try: deb = body_mako_tpl.render(helper=helper, css=css, _debug=tools.ustr("\n".join(htmls)), diff --git a/account_financial_report_webkit/wizard/balance_common.py b/account_financial_report_webkit/wizard/balance_common.py index fb7c1e9d..5225b671 100644 --- a/account_financial_report_webkit/wizard/balance_common.py +++ b/account_financial_report_webkit/wizard/balance_common.py @@ -3,7 +3,7 @@ # # Copyright (c) 2011 Camptocamp SA (http://www.camptocamp.com) # -# Author : Guewen Baconnier (Camptocamp) +# Author: Guewen Baconnier (Camptocamp) # # WARNING: This program as such is intended to be used by professional # programmers who take the whole responsability of assessing all potential @@ -88,8 +88,8 @@ class AccountBalanceCommonWizard(orm.TransientModel): ('filter_opening', 'Opening Only')], "Filter by", required=True, - help='Filter by date : no opening balance will be displayed. ' - '(opening balance can only be calculated based on period to be correct).'), + help='Filter by date: no opening balance will be displayed. ' + '(opening balance can only be computed based on period to be correct).'), } for index in range(COMPARISON_LEVEL): diff --git a/account_financial_report_webkit/wizard/partners_ledger_wizard.py b/account_financial_report_webkit/wizard/partners_ledger_wizard.py index 46e59a63..b4204a56 100644 --- a/account_financial_report_webkit/wizard/partners_ledger_wizard.py +++ b/account_financial_report_webkit/wizard/partners_ledger_wizard.py @@ -34,10 +34,13 @@ class AccountReportPartnersLedgerWizard(orm.TransientModel): 'amount_currency': fields.boolean("With Currency", help="It adds the currency column"), 'partner_ids': fields.many2many('res.partner', string='Filter on partner', - help="Only selected partners will be printed. Leave empty to print all partners."), + help="Only selected partners will be printed. " + "Leave empty to print all partners."), 'filter': fields.selection([('filter_no', 'No Filters'), ('filter_date', 'Date'), - ('filter_period', 'Periods')], "Filter by", required=True, help='Filter by date : no opening balance will be displayed. (opening balance can only be calculated based on period to be correct).'), + ('filter_period', 'Periods')], "Filter by", required=True, + help='Filter by date: no opening balance will be displayed. ' + '(opening balance can only be computed based on period to be correct).'), } _defaults = { 'amount_currency': False, @@ -51,7 +54,10 @@ class AccountReportPartnersLedgerWizard(orm.TransientModel): return True _constraints = [ - (_check_fiscalyear, 'When no Fiscal year is selected, you must choose to filter by periods or by date.', ['filter']), + (_check_fiscalyear, + 'When no Fiscal year is selected, you must choose to ' + 'filter by periods or by date.', + ['filter']), ] def onchange_filter(self, cr, uid, ids, filter='filter_no', fiscalyear_id=False, context=None):