diff --git a/account_financial_report_webkit/README.rst b/account_financial_report_webkit/README.rst index cfdf6558..f58645d7 100644 --- a/account_financial_report_webkit/README.rst +++ b/account_financial_report_webkit/README.rst @@ -99,7 +99,7 @@ like the trial balance but add an extra information : * Total balance (all figures must match with same date partner balance report). - This column equals the sum of all following columns) + This column equals the sum of all following columns) * Due * Overdue <= 30 days diff --git a/account_financial_report_webkit/report/aged_open_invoices.py b/account_financial_report_webkit/report/aged_open_invoices.py index 0241c85f..2404f774 100644 --- a/account_financial_report_webkit/report/aged_open_invoices.py +++ b/account_financial_report_webkit/report/aged_open_invoices.py @@ -45,6 +45,7 @@ def make_ranges(top, offset): ranges.append((top, 100000000000)) return ranges + # list of overdue ranges RANGES = make_ranges(120, 30) @@ -56,6 +57,7 @@ def make_ranges_titles(): titles.append(_('Overdue > %s d.') % RANGES[-1][0]) return titles + # list of overdue ranges title RANGES_TITLES = make_ranges_titles() # list of payable journal types @@ -408,6 +410,7 @@ class AccountAgedOpenInvoicesWebkit(PartnersOpenInvoicesWebkit): res = self.cr.fetchall() return dict((x[0], x[1]) for x in res) + HeaderFooterTextWebKitParser( 'report.account.account_aged_open_invoices_webkit', 'account.account', diff --git a/account_financial_report_webkit/report/aged_partner_balance.py b/account_financial_report_webkit/report/aged_partner_balance.py index 5b09d8ee..1f640c14 100644 --- a/account_financial_report_webkit/report/aged_partner_balance.py +++ b/account_financial_report_webkit/report/aged_partner_balance.py @@ -43,6 +43,7 @@ def make_ranges(top, offset): ranges.append((top, 100000000000)) return ranges + # list of overdue ranges RANGES = make_ranges(120, 30) @@ -54,6 +55,7 @@ def make_ranges_titles(): titles.append(_('Overdue > %s d.') % RANGES[-1][0]) return titles + # list of overdue ranges title RANGES_TITLES = make_ranges_titles() # list of payable journal types @@ -420,6 +422,7 @@ class AccountAgedTrialBalanceWebkit(PartnersOpenInvoicesWebkit): res = self.cr.fetchall() return dict((x[0], x[1]) for x in res) + HeaderFooterTextWebKitParser( 'report.account.account_aged_trial_balance_webkit', 'account.account', diff --git a/account_financial_report_webkit/report/open_invoices.py b/account_financial_report_webkit/report/open_invoices.py index 158acf85..bfb2bb35 100644 --- a/account_financial_report_webkit/report/open_invoices.py +++ b/account_financial_report_webkit/report/open_invoices.py @@ -40,6 +40,7 @@ def get_mako_template(obj, *args): template_path = get_module_resource(*args) return Template(filename=template_path, input_encoding='utf-8') + report_helper.WebKitHelper.get_mako_template = get_mako_template diff --git a/account_financial_report_webkit/report/partner_balance.py b/account_financial_report_webkit/report/partner_balance.py index 1e039bb7..f836be6c 100644 --- a/account_financial_report_webkit/report/partner_balance.py +++ b/account_financial_report_webkit/report/partner_balance.py @@ -93,6 +93,7 @@ class PartnerBalanceWebkit(report_sxw.rml_parse, return super(PartnerBalanceWebkit, self).set_context( objects, data, new_ids, report_type=report_type) + HeaderFooterTextWebKitParser( 'report.account.account_report_partner_balance_webkit', 'account.account', diff --git a/account_financial_report_webkit/report/print_journal.py b/account_financial_report_webkit/report/print_journal.py index c693444e..3c6f8e1f 100755 --- a/account_financial_report_webkit/report/print_journal.py +++ b/account_financial_report_webkit/report/print_journal.py @@ -158,6 +158,7 @@ class PrintJournalWebkit(report_sxw.rml_parse, CommonReportHeaderWebkit): return super(PrintJournalWebkit, self).set_context( objects, data, new_ids, report_type=report_type) + HeaderFooterTextWebKitParser( 'report.account.account_report_print_journal_webkit', 'account.journal.period', diff --git a/account_financial_report_webkit/report/trial_balance.py b/account_financial_report_webkit/report/trial_balance.py index 27c202b5..e663fa53 100644 --- a/account_financial_report_webkit/report/trial_balance.py +++ b/account_financial_report_webkit/report/trial_balance.py @@ -85,6 +85,7 @@ class TrialBalanceWebkit(report_sxw.rml_parse, return super(TrialBalanceWebkit, self).set_context( objects, data, new_ids, report_type=report_type) + HeaderFooterTextWebKitParser( 'report.account.account_report_trial_balance_webkit', 'account.account', diff --git a/account_financial_report_webkit/wizard/balance_common.py b/account_financial_report_webkit/wizard/balance_common.py index fe4b85d0..591c8799 100644 --- a/account_financial_report_webkit/wizard/balance_common.py +++ b/account_financial_report_webkit/wizard/balance_common.py @@ -392,7 +392,7 @@ class AccountBalanceCommonWizard(orm.TransientModel): def pre_print_report(self, cr, uid, ids, data, context=None): data = super(AccountBalanceCommonWizard, self).pre_print_report( - cr, uid, ids, data, context) + cr, uid, ids, data, context=context) if context is None: context = {} diff --git a/account_financial_report_webkit/wizard/general_ledger_wizard.py b/account_financial_report_webkit/wizard/general_ledger_wizard.py index f13a5816..b820a9ad 100644 --- a/account_financial_report_webkit/wizard/general_ledger_wizard.py +++ b/account_financial_report_webkit/wizard/general_ledger_wizard.py @@ -78,7 +78,7 @@ class AccountReportGeneralLedgerWizard(orm.TransientModel): def pre_print_report(self, cr, uid, ids, data, context=None): data = super(AccountReportGeneralLedgerWizard, self).pre_print_report( - cr, uid, ids, data, context) + cr, uid, ids, data, context=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, diff --git a/account_financial_report_webkit/wizard/open_invoices_wizard.py b/account_financial_report_webkit/wizard/open_invoices_wizard.py index 7b57423c..5ba70cc8 100644 --- a/account_financial_report_webkit/wizard/open_invoices_wizard.py +++ b/account_financial_report_webkit/wizard/open_invoices_wizard.py @@ -133,7 +133,7 @@ are still unpaid today (today is my clearance date)?' def pre_print_report(self, cr, uid, ids, data, context=None): data = super(AccountReportOpenInvoicesWizard, self).pre_print_report( - cr, uid, ids, data, context) + cr, uid, ids, data, context=context) vals = self.read(cr, uid, ids, ['until_date', 'group_by_currency'], context=context)[0] diff --git a/account_financial_report_webkit/wizard/partners_ledger_wizard.py b/account_financial_report_webkit/wizard/partners_ledger_wizard.py index 48a33396..d384b6b0 100644 --- a/account_financial_report_webkit/wizard/partners_ledger_wizard.py +++ b/account_financial_report_webkit/wizard/partners_ledger_wizard.py @@ -121,7 +121,7 @@ class AccountReportPartnersLedgerWizard(orm.TransientModel): def pre_print_report(self, cr, uid, ids, data, context=None): data = super(AccountReportPartnersLedgerWizard, self).pre_print_report( - cr, uid, ids, data, context) + cr, uid, ids, data, context=context) if context is None: context = {} # will be used to attach the report on the main account diff --git a/account_financial_report_webkit/wizard/print_journal.py b/account_financial_report_webkit/wizard/print_journal.py index b1bad692..1f23fb8e 100644 --- a/account_financial_report_webkit/wizard/print_journal.py +++ b/account_financial_report_webkit/wizard/print_journal.py @@ -59,7 +59,7 @@ class AccountReportPrintJournalWizard(orm.TransientModel): def pre_print_report(self, cr, uid, ids, data, context=None): data = super(AccountReportPrintJournalWizard, self).\ - pre_print_report(cr, uid, ids, data, context) + pre_print_report(cr, uid, ids, data, context=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, diff --git a/account_financial_report_webkit_xls/report/__init__.py b/account_financial_report_webkit_xls/report/__init__.py index f82c52fa..2e7d18c6 100644 --- a/account_financial_report_webkit_xls/report/__init__.py +++ b/account_financial_report_webkit_xls/report/__init__.py @@ -1,25 +1,4 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# -# Copyright (c) 2013 Noviat nv/sa (www.noviat.com). All rights reserved. -# -# 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 . -# -############################################################################## - +# -*- coding: utf-8 -*- from . import general_ledger_xls from . import trial_balance_xls from . import partners_balance_xls diff --git a/account_financial_report_webkit_xls/report/general_ledger_xls.py b/account_financial_report_webkit_xls/report/general_ledger_xls.py index 58c0e905..304f7fd7 100644 --- a/account_financial_report_webkit_xls/report/general_ledger_xls.py +++ b/account_financial_report_webkit_xls/report/general_ledger_xls.py @@ -1,25 +1,6 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# -# Copyright (c) 2013 Noviat nv/sa (www.noviat.com). All rights reserved. -# -# 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 . -# -############################################################################## - +# -*- coding: utf-8 -*- +# Copyright 2009-2016 Noviat +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). import xlwt from datetime import datetime from openerp.addons.report_xls.report_xls import report_xls @@ -345,6 +326,7 @@ class general_ledger_xls(report_xls): ws, row_pos, row_data, c_hdr_cell_style) row_pos += 1 + general_ledger_xls('report.account.account_report_general_ledger_xls', 'account.account', parser=GeneralLedgerWebkit) diff --git a/account_financial_report_webkit_xls/report/open_invoices_xls.py b/account_financial_report_webkit_xls/report/open_invoices_xls.py index c64a5ed0..c9aa9f36 100644 --- a/account_financial_report_webkit_xls/report/open_invoices_xls.py +++ b/account_financial_report_webkit_xls/report/open_invoices_xls.py @@ -1,25 +1,6 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# -# Copyright (c) 2013 Noviat nv/sa (www.noviat.com). All rights reserved. -# -# 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 . -# -############################################################################## - +# -*- coding: utf-8 -*- +# Copyright 2009-2016 Noviat +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). import xlwt from datetime import datetime from openerp.addons.report_xls.report_xls import report_xls @@ -824,5 +805,6 @@ class open_invoices_xls(report_xls): row_pos, acc, _xs, xlwt, _p, data) row_pos += 1 + open_invoices_xls('report.account.account_report_open_invoices_xls', 'account.account', parser=PartnersOpenInvoicesWebkit) diff --git a/account_financial_report_webkit_xls/report/partner_ledger_xls.py b/account_financial_report_webkit_xls/report/partner_ledger_xls.py index 10527974..504fe2d0 100644 --- a/account_financial_report_webkit_xls/report/partner_ledger_xls.py +++ b/account_financial_report_webkit_xls/report/partner_ledger_xls.py @@ -1,25 +1,6 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# -# Copyright (c) 2013 Noviat nv/sa (www.noviat.com). All rights reserved. -# -# 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 . -# -############################################################################## - +# -*- coding: utf-8 -*- +# Copyright 2009-2016 Noviat +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). import xlwt from datetime import datetime from openerp.addons.report_xls.report_xls import report_xls @@ -456,6 +437,7 @@ class partner_ledger_xls(report_xls): ws, row_pos, row_data, account_cell_style) row_pos += 2 + partner_ledger_xls('report.account.account_report_partner_ledger_xls', 'account.account', parser=PartnersLedgerWebkit) diff --git a/account_financial_report_webkit_xls/report/partners_balance_xls.py b/account_financial_report_webkit_xls/report/partners_balance_xls.py index 9255b567..b282b69b 100644 --- a/account_financial_report_webkit_xls/report/partners_balance_xls.py +++ b/account_financial_report_webkit_xls/report/partners_balance_xls.py @@ -1,25 +1,6 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# -# Copyright (c) 2013 Noviat nv/sa (www.noviat.com). All rights reserved. -# -# 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 . -# -############################################################################## - +# -*- coding: utf-8 -*- +# Copyright 2009-2016 Noviat +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). import xlwt from openerp.addons.report_xls.report_xls import report_xls from openerp.addons.report_xls.utils import rowcol_to_cell @@ -427,6 +408,7 @@ class partners_balance_xls(report_xls): row_pos = self.print_account_totals( _xs, xlwt, ws, row_account_start, row_pos, current_account, _p) + partners_balance_xls('report.account.account_report_partner_balance_xls', 'account.account', parser=PartnerBalanceWebkit) diff --git a/account_financial_report_webkit_xls/report/trial_balance_xls.py b/account_financial_report_webkit_xls/report/trial_balance_xls.py index 476375a0..8cd5c3d5 100644 --- a/account_financial_report_webkit_xls/report/trial_balance_xls.py +++ b/account_financial_report_webkit_xls/report/trial_balance_xls.py @@ -1,25 +1,6 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# -# Copyright (c) 2013 Noviat nv/sa (www.noviat.com). All rights reserved. -# -# 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 . -# -############################################################################## - +# -*- coding: utf-8 -*- +# Copyright 2009-2016 Noviat +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). import xlwt from openerp.addons.report_xls.report_xls import report_xls from openerp.addons.report_xls.utils import rowcol_to_cell @@ -319,6 +300,7 @@ class trial_balance_xls(report_xls): row_pos = self.xls_write_row( ws, row_pos, row_data, row_style=cell_style) + trial_balance_xls('report.account.account_report_trial_balance_xls', 'account.account', parser=TrialBalanceWebkit) diff --git a/account_journal_report_xls/report/nov_account_journal.py b/account_journal_report_xls/report/nov_account_journal.py index f400d14e..bb8ed135 100644 --- a/account_journal_report_xls/report/nov_account_journal.py +++ b/account_journal_report_xls/report/nov_account_journal.py @@ -1,24 +1,6 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# -# Copyright (c) 2014 Noviat nv/sa (www.noviat.com). All rights reserved. -# -# 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 . -# -############################################################################## +# -*- coding: utf-8 -*- +# Copyright 2009-2016 Noviat +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). import time from openerp.report import report_sxw @@ -215,7 +197,11 @@ class nov_journal_print(report_sxw.rml_parse): code_string = j_obj._report_xls_document_extra( self.cr, self.uid, self.context) # _logger.warn('code_string= %s', code_string) - [x.update({'docname': eval(code_string) or '-'}) for x in lines] + # disable=W0123, safe_eval doesn't apply here since + # code_string comes from python module + [x.update( + {'docname': eval(code_string) or '-'}) # pylint: disable=W0123 + for x in lines] # group lines if self.group_entries: @@ -352,6 +338,7 @@ class nov_journal_print(report_sxw.rml_parse): value, digits, date, date_time, grouping, monetary, dp, currency_obj) + report_sxw.report_sxw( 'report.nov.account.journal.print', 'account.journal', 'addons/account_journal_report_xls/report/nov_account_journal.rml', diff --git a/account_journal_report_xls/report/nov_account_journal_xls.py b/account_journal_report_xls/report/nov_account_journal_xls.py index 75fe9215..eab96259 100644 --- a/account_journal_report_xls/report/nov_account_journal_xls.py +++ b/account_journal_report_xls/report/nov_account_journal_xls.py @@ -1,24 +1,6 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# -# Copyright (c) 2013 Noviat nv/sa (www.noviat.com). All rights reserved. -# -# 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 . -# -############################################################################## +# -*- coding: utf-8 -*- +# Copyright 2009-2016 Noviat +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). import xlwt from datetime import datetime @@ -404,5 +386,6 @@ class account_journal_xls(report_xls): row_pos = self._journal_lines(o, ws, _p, row_pos, _xs) row_pos = self._journal_vat_summary(o, ws, _p, row_pos, _xs) + account_journal_xls('report.nov.account.journal.xls', 'account.journal.period', parser=account_journal_xls_parser) diff --git a/account_move_line_report_xls/report/move_line_list_xls.py b/account_move_line_report_xls/report/move_line_list_xls.py index 0bb4e496..bff55ea3 100644 --- a/account_move_line_report_xls/report/move_line_list_xls.py +++ b/account_move_line_report_xls/report/move_line_list_xls.py @@ -1,25 +1,6 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# -# Copyright (c) 2014 Noviat nv/sa (www.noviat.com). All rights reserved. -# -# 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 . -# -############################################################################## - +# -*- coding: utf-8 -*- +# Copyright 2009-2016 Noviat +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). import xlwt from datetime import datetime from openerp.osv import orm @@ -368,6 +349,7 @@ class move_line_xls(report_xls): row_pos = self.xls_write_row( ws, row_pos, row_data, row_style=self.rt_cell_style_right) + move_line_xls('report.move.line.list.xls', 'account.move.line', parser=move_line_xls_parser)