From b170a15dfb61c89a06cbe37b4a5cf87141edadd0 Mon Sep 17 00:00:00 2001 From: luc-demeyer Date: Fri, 30 Dec 2016 18:30:36 +0100 Subject: [PATCH] [ADD] XLS report to Aged Partner Balance --- .../__init__.py | 23 +- .../__openerp__.py | 27 +- .../report/__init__.py | 1 + .../report/aged_partner_balance_xls.py | 280 +++++++++ .../report/trial_balance_xls.py | 28 +- .../static/description/icon.svg | 556 ------------------ .../wizard/__init__.py | 24 +- .../wizard/aged_partner_balance_wizard.py | 25 + .../wizard/aged_partner_balance_wizard.xml | 21 + .../wizard/general_ledger_wizard.py | 33 +- .../wizard/general_ledger_wizard_view.xml | 22 +- .../wizard/open_invoices_wizard.py | 33 +- .../wizard/open_invoices_wizard_view.xml | 22 +- .../wizard/partners_balance_wizard.py | 33 +- .../wizard/partners_balance_wizard_view.xml | 24 +- .../wizard/partners_ledger_wizard.py | 41 +- .../wizard/partners_ledger_wizard_view.xml | 22 +- .../wizard/trial_balance_wizard.py | 33 +- .../wizard/trial_balance_wizard_view.xml | 24 +- 19 files changed, 438 insertions(+), 834 deletions(-) create mode 100644 account_financial_report_webkit_xls/report/aged_partner_balance_xls.py delete mode 100644 account_financial_report_webkit_xls/static/description/icon.svg create mode 100644 account_financial_report_webkit_xls/wizard/aged_partner_balance_wizard.py create mode 100644 account_financial_report_webkit_xls/wizard/aged_partner_balance_wizard.xml diff --git a/account_financial_report_webkit_xls/__init__.py b/account_financial_report_webkit_xls/__init__.py index 49db08a9..5c3bc2f8 100644 --- a/account_financial_report_webkit_xls/__init__.py +++ b/account_financial_report_webkit_xls/__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 -*- try: from . import wizard from . import report diff --git a/account_financial_report_webkit_xls/__openerp__.py b/account_financial_report_webkit_xls/__openerp__.py index 024a2b31..ff8078d7 100644 --- a/account_financial_report_webkit_xls/__openerp__.py +++ b/account_financial_report_webkit_xls/__openerp__.py @@ -1,27 +1,9 @@ -# -*- 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). { 'name': 'Add XLS export to accounting reports', - 'version': '8.0.0.4.0', + 'version': '8.0.0.5.0', 'license': 'AGPL-3', 'author': "Noviat,Odoo Community Association (OCA)", 'category': 'Generic Modules/Accounting', @@ -43,6 +25,7 @@ 'wizard/partners_ledger_wizard_view.xml', 'wizard/partners_balance_wizard_view.xml', 'wizard/open_invoices_wizard_view.xml', + 'wizard/aged_partner_balance_wizard.xml', ], 'test': ['tests/general_ledger.yml', 'tests/partner_ledger.yml', diff --git a/account_financial_report_webkit_xls/report/__init__.py b/account_financial_report_webkit_xls/report/__init__.py index 2e7d18c6..302e50c7 100644 --- a/account_financial_report_webkit_xls/report/__init__.py +++ b/account_financial_report_webkit_xls/report/__init__.py @@ -4,3 +4,4 @@ from . import trial_balance_xls from . import partners_balance_xls from . import partner_ledger_xls from . import open_invoices_xls +from . import aged_partner_balance_xls diff --git a/account_financial_report_webkit_xls/report/aged_partner_balance_xls.py b/account_financial_report_webkit_xls/report/aged_partner_balance_xls.py new file mode 100644 index 00000000..a7d16006 --- /dev/null +++ b/account_financial_report_webkit_xls/report/aged_partner_balance_xls.py @@ -0,0 +1,280 @@ +# -*- 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 +from openerp.addons.account_financial_report_webkit.report \ + .aged_partner_balance import AccountAgedTrialBalanceWebkit +from openerp.tools.translate import _ +# import logging +# _logger = logging.getLogger(__name__) + + +class AccountAgedTrialBalanceWebkitXls(report_xls): + + def create(self, cr, uid, ids, data, context=None): + self._column_sizes = [ + 30, # Partner + 20, # Partner Code + 20, # Balance + 20, # Due + 20, # Overdue 0-30 + 20, # Overdue 30-60 + 20, # Overdue 60-90 + 20, # Overdue 90-120 + 20, # Overdue 120+ + ] + self._balance_pos = 2 + return super(AccountAgedTrialBalanceWebkitXls, self).create( + cr, uid, ids, data, context=context) + + def _cell_styles(self, _xs): + self._style_title = xlwt.easyxf(_xs['xls_title']) + self._style_bold_blue_center = xlwt.easyxf( + _xs['bold'] + _xs['fill_blue'] + _xs['borders_all'] + + _xs['center']) + self._style_center = xlwt.easyxf( + _xs['borders_all'] + _xs['wrap'] + _xs['center']) + + format_yellow_bold = _xs['bold'] + _xs['fill'] + _xs['borders_all'] + self._style_account_title = xlwt.easyxf( + format_yellow_bold + _xs['xls_title']) + self._style_yellow_bold = xlwt.easyxf(format_yellow_bold) + self._style_yellow_bold_right = xlwt.easyxf( + format_yellow_bold + _xs['right']) + self._style_yellow_bold_decimal = xlwt.easyxf( + format_yellow_bold + _xs['right'], + num_format_str=report_xls.decimal_format) + + self._style_default = xlwt.easyxf(_xs['borders_all']) + self._style_decimal = xlwt.easyxf( + _xs['borders_all'] + _xs['right'], + num_format_str=report_xls.decimal_format) + self._style_percent = xlwt.easyxf( + _xs['borders_all'] + _xs['right'], + num_format_str='0.00%') + + def _setup_worksheet(self, _p, _xs, data, wb): + self.ws = wb.add_sheet(_p.report_name[:31]) + self.ws.panes_frozen = True + self.ws.remove_splits = True + self.ws.portrait = 0 # Landscape + self.ws.fit_width_to_pages = 1 + self.ws.header_str = self.xls_headers['standard'] + self.ws.footer_str = self.xls_footers['standard'] + + def _print_title(self, _p, _xs, data, row_pos): + report_name = ' - '.join( + [_p.report_name.upper(), + _p.company.partner_id.name, + _p.company.currency_id.name]) + c_specs = [ + ('report_name', 1, 0, 'text', report_name), + ] + row_data = self.xls_row_template(c_specs, [x[0] for x in c_specs]) + row_pos = self.xls_write_row( + self.ws, row_pos, row_data, row_style=self._style_title) + return row_pos + + def _print_empty_row(self, _p, _xs, data, row_pos): + """ + Print empty row to define column sizes + """ + c_specs = [('empty%s' % i, 1, self._column_sizes[i], 'text', None) + for i in range(len(self._column_sizes))] + row_data = self.xls_row_template(c_specs, [x[0] for x in c_specs]) + row_pos = self.xls_write_row( + self.ws, row_pos, row_data, set_column_size=True) + return row_pos + + def _print_header_title(self, _p, _xs, data, row_pos): + c_specs = [ + ('coa', 1, 0, 'text', _('Chart of Account')), + ('fy', 1, 0, 'text', _('Fiscal Year')), + ('period_filter', 2, 0, 'text', _('Periods Filter')), + ('cd', 1, 0, 'text', _('Clearance Date')), + ('account_filter', 2, 0, 'text', _('Accounts Filter')), + ('partner_filter', 1, 0, 'text', _('Partners Filter')), + ('tm', 1, 0, 'text', _('Target Moves')), + ] + row_data = self.xls_row_template(c_specs, [x[0] for x in c_specs]) + row_pos = self.xls_write_row( + self.ws, row_pos, row_data, + row_style=self._style_bold_blue_center) + return row_pos + + def _print_header_data(self, _p, _xs, data, row_pos): + period_filter = _('From') + ': ' + period_filter += _p.start_period.name if _p.start_period else u'' + period_filter += ' ' + _('To') + ': ' + period_filter += _p.stop_period.name if _p.stop_period else u'' + c_specs = [ + ('coa', 1, 0, 'text', _p.chart_account.name), + ('fy', 1, 0, 'text', + _p.fiscalyear.name if _p.fiscalyear else '-'), + ('period_filter', 2, 0, 'text', period_filter), + ('cd', 1, 0, 'text', _p.date_until), + ('account_filter', 2, 0, 'text', + _p.display_partner_account(data)), + ('partner_filter', 1, 0, 'text', + _('Selected Partners') if _p.partner_ids else '-'), + ('tm', 1, 0, 'text', + _p.display_target_move(data)), + ] + row_data = self.xls_row_template(c_specs, [x[0] for x in c_specs]) + row_pos = self.xls_write_row( + self.ws, row_pos, row_data, row_style=self._style_center) + return row_pos + + def _print_header(self, _p, _xs, data, row_pos): + """ + Header Table: Chart of Account, Fiscal year, Filters, ... + """ + row_pos = self._print_header_title(_p, _xs, data, row_pos) + row_pos = self._print_header_data(_p, _xs, data, row_pos) + self.ws.set_horz_split_pos(row_pos) # freeze the line + return row_pos + 1 + + def _print_account_header(self, _p, _xs, data, row_pos, account): + """ + Fill in a row with the code and name of the account + """ + c_specs = [ + ('acc_title', len(self._column_sizes), 0, 'text', + ' - '.join([account.code, account.name])), + ] + row_data = self.xls_row_template(c_specs, [x[0] for x in c_specs]) + row_pos = self.xls_write_row( + self.ws, row_pos, row_data, self._style_account_title) + return row_pos + 1 + + def _print_partner_header(self, _p, _xs, data, row_pos): + """ + Partner header line + """ + c_specs = [ + ('partner_h', 1, 0, 'text', _('Partner'), + None, self._style_yellow_bold), + ('pcode_h', 1, 0, 'text', _('Code'), + None, self._style_yellow_bold), + ('balance_h', 1, 0, 'text', _('Balance')), + ('due_h', 1, 0, 'text', _('Due'))] + for days in [30, 60, 90, 120]: + entry = 'od_%s_h' % days + label = _("Overdue ≤ %s d.") % days + c_specs += [(entry, 1, 0, 'text', label)] + c_specs += [('older_h', 1, 0, 'text', _("Older"))] + row_data = self.xls_row_template(c_specs, [x[0] for x in c_specs]) + row_pos = self.xls_write_row( + self.ws, row_pos, row_data, + row_style=self._style_yellow_bold_right) + return row_pos + + def _print_partner_line(self, _p, _xs, data, row_pos, partner, line): + """ + Partner data line + """ + partner_name, p_id, p_ref, p_name = partner + c_specs = [ + ('partner', 1, 0, 'text', p_name, + None, self._style_default), + ('pcode', 1, 0, 'text', p_ref, + None, self._style_default), + ('balance', 1, 0, 'number', line['balance'])] + for r in _p.ranges: + entry = 'od_%s' % r[0] + c_specs += [(entry, 1, 0, 'number', line['aged_lines'][r])] + row_data = self.xls_row_template(c_specs, [x[0] for x in c_specs]) + row_pos = self.xls_write_row( + self.ws, row_pos, row_data, + row_style=self._style_decimal) + return row_pos + + def _print_partner_footer(self, _p, _xs, data, row_pos, + account, line_count): + """ + Partner header line + """ + # Totals + c_specs = [ + ('total', 1, 0, 'text', _('Total') + ' ' + account.code, + None, self._style_yellow_bold), + ('empty', 1, 0, 'text', None, + None, self._style_yellow_bold)] + row_start = row_pos - line_count + col_start = self._balance_pos + start = rowcol_to_cell(row_start, col_start) + stop = rowcol_to_cell(row_pos - 1, col_start) + formula = 'SUM(%s:%s)' % (start, stop) + c_specs += [('total_balance', 1, 0, 'number', None, formula)] + col_start += 1 + for i, r in enumerate(_p.ranges): + entry = 'total_%s' % i + start = rowcol_to_cell(row_start, col_start + i) + stop = rowcol_to_cell(row_pos - 1, col_start + i) + formula = 'SUM(%s:%s)' % (start, stop) + c_specs += [(entry, 1, 0, 'number', None, formula)] + row_data = self.xls_row_template(c_specs, [x[0] for x in c_specs]) + row_pos = self.xls_write_row( + self.ws, row_pos, row_data, + row_style=self._style_yellow_bold_decimal) + + # percents + c_specs = [ + ('pct', 1, 0, 'text', _('Percentages') + ' ' + account.code, + None, self._style_default), + ('empty', 2, 0, 'text', None, + None, self._style_default)] + total_balance = rowcol_to_cell(row_pos - 1, self._balance_pos) + for i, r in enumerate(_p.ranges): + entry = 'pct_%s' % i + total_range = rowcol_to_cell(row_pos - 1, col_start + i) + formula = '%s/%s' % (total_range, total_balance) + c_specs += [(entry, 1, 0, 'number', None, formula)] + row_data = self.xls_row_template(c_specs, [x[0] for x in c_specs]) + row_pos = self.xls_write_row( + self.ws, row_pos, row_data, + row_style=self._style_percent) + + return row_pos + + def _print_account_data(self, _p, _xs, data, row_pos, account): + if _p.agged_lines_accounts.get(account.id): + row_pos = self._print_account_header( + _p, _xs, data, row_pos, account) + lines = _p.agged_lines_accounts[account.id] + + row_pos = self._print_partner_header( + _p, _xs, data, row_pos) + row_pos_start = row_pos + for partner in _p.partners_order[account.id]: + partner_id = partner[1] + if partner_id in lines: + line = lines[partner_id] + row_pos = self._print_partner_line( + _p, _xs, data, row_pos, partner, line) + line_count = row_pos - row_pos_start + row_pos = self._print_partner_footer( + _p, _xs, data, row_pos, account, line_count) + return row_pos + 1 + + def generate_xls_report(self, _p, _xs, data, objects, wb): + + self._cell_styles(_xs) + self._setup_worksheet(_p, _xs, data, wb) + + row_pos = 0 + row_pos = self._print_title(_p, _xs, data, row_pos) + row_pos = self._print_empty_row(_p, _xs, data, row_pos) + row_pos = self._print_header(_p, _xs, data, row_pos) + + for account in objects: + row_pos = self._print_account_data( + _p, _xs, data, row_pos, account) + + +AccountAgedTrialBalanceWebkitXls( + 'report.account.account_report_aged_partner_balance_xls', + 'account.account', + parser=AccountAgedTrialBalanceWebkit) 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 8cd5c3d5..fde93c06 100644 --- a/account_financial_report_webkit_xls/report/trial_balance_xls.py +++ b/account_financial_report_webkit_xls/report/trial_balance_xls.py @@ -11,8 +11,13 @@ from openerp.tools.translate import _ # _logger = logging.getLogger(__name__) -class trial_balance_xls(report_xls): - column_sizes = [12, 60, 17, 17, 17, 17, 17, 17] +class TrialBalanceXls(report_xls): + + def create(self, cr, uid, ids, data, context=None): + self._column_sizes = [12, 60, 17, 17, 17, 17, 17, 17] + self._debit_pos = 4 + return super(TrialBalanceXls, self).create( + cr, uid, ids, data, context=context) def generate_xls_report(self, _p, _xs, data, objects, wb): @@ -45,7 +50,7 @@ class trial_balance_xls(report_xls): ws, row_pos, row_data, row_style=cell_style) # write empty row to define column sizes - c_sizes = self.column_sizes + c_sizes = self._column_sizes c_specs = [('empty%s' % i, 1, c_sizes[i], 'text', None) for i in range(0, len(c_sizes))] row_data = self.xls_row_template(c_specs, [x[0] for x in c_specs]) @@ -246,15 +251,14 @@ class trial_balance_xls(report_xls): ('account', account_span, 0, 'text', current_account.name), ] if _p.comparison_mode == 'no_comparison': - - debit_cell = rowcol_to_cell(row_pos, 4) - credit_cell = rowcol_to_cell(row_pos, 5) + debit_cell = rowcol_to_cell(row_pos, self._debit_pos) + credit_cell = rowcol_to_cell(row_pos, self._debit_pos + 1) bal_formula = debit_cell + '-' + credit_cell if _p.initial_balance_mode: - init_cell = rowcol_to_cell(row_pos, 3) - debit_cell = rowcol_to_cell(row_pos, 4) - credit_cell = rowcol_to_cell(row_pos, 5) + init_cell = rowcol_to_cell(row_pos, self._debit_pos - 1) + debit_cell = rowcol_to_cell(row_pos, self._debit_pos) + credit_cell = rowcol_to_cell(row_pos, self._debit_pos + 1) bal_formula = init_cell + '+' + \ debit_cell + '-' + credit_cell c_specs += [('init_bal', 1, 0, 'number', @@ -301,6 +305,6 @@ class trial_balance_xls(report_xls): ws, row_pos, row_data, row_style=cell_style) -trial_balance_xls('report.account.account_report_trial_balance_xls', - 'account.account', - parser=TrialBalanceWebkit) +TrialBalanceXls('report.account.account_report_trial_balance_xls', + 'account.account', + parser=TrialBalanceWebkit) diff --git a/account_financial_report_webkit_xls/static/description/icon.svg b/account_financial_report_webkit_xls/static/description/icon.svg deleted file mode 100644 index 1d087e94..00000000 --- a/account_financial_report_webkit_xls/static/description/icon.svg +++ /dev/null @@ -1,556 +0,0 @@ - - - - - - - - spain_provinces - - - - spain - geography - - - - - sherrera - - - - - sherrera - - - - - sherrera - - - - image/svg+xml - - - en - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/account_financial_report_webkit_xls/wizard/__init__.py b/account_financial_report_webkit_xls/wizard/__init__.py index 7de0a818..29f9b837 100644 --- a/account_financial_report_webkit_xls/wizard/__init__.py +++ b/account_financial_report_webkit_xls/wizard/__init__.py @@ -1,27 +1,7 @@ -# -*- 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_wizard from . import trial_balance_wizard from . import partners_balance_wizard from . import partners_ledger_wizard from . import open_invoices_wizard +from . import aged_partner_balance_wizard diff --git a/account_financial_report_webkit_xls/wizard/aged_partner_balance_wizard.py b/account_financial_report_webkit_xls/wizard/aged_partner_balance_wizard.py new file mode 100644 index 00000000..b70b23eb --- /dev/null +++ b/account_financial_report_webkit_xls/wizard/aged_partner_balance_wizard.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +# Copyright 2009-2016 Noviat. +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from openerp import models + + +class AccountAgedTrialBalance(models.TransientModel): + _inherit = 'account.aged.trial.balance.webkit' + + def xls_export(self, cr, uid, ids, context=None): + return self.check_report(cr, uid, ids, context=context) + + def _print_report(self, cr, uid, ids, data, context=None): + context = context or {} + if context.get('xls_export'): + # we update form with display account value + data = self.pre_print_report(cr, uid, ids, data, context=context) + return { + 'type': 'ir.actions.report.xml', + 'report_name': + 'account.account_report_aged_partner_balance_xls', + 'datas': data} + else: + return super(AccountAgedTrialBalance, self)._print_report( + cr, uid, ids, data, context=context) diff --git a/account_financial_report_webkit_xls/wizard/aged_partner_balance_wizard.xml b/account_financial_report_webkit_xls/wizard/aged_partner_balance_wizard.xml new file mode 100644 index 00000000..7d52859f --- /dev/null +++ b/account_financial_report_webkit_xls/wizard/aged_partner_balance_wizard.xml @@ -0,0 +1,21 @@ + + + + + + account.aged.trial.balance.webkit.xls + account.aged.trial.balance.webkit + form + + + + 6 + + + + + + + diff --git a/account_financial_report_webkit_xls/wizard/general_ledger_wizard.py b/account_financial_report_webkit_xls/wizard/general_ledger_wizard.py index 99ab9d07..d0d394cc 100644 --- a/account_financial_report_webkit_xls/wizard/general_ledger_wizard.py +++ b/account_financial_report_webkit_xls/wizard/general_ledger_wizard.py @@ -1,31 +1,10 @@ -# -*- 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). +from openerp import models -from openerp.osv import orm -# import logging -# _logger = logging.getLogger(__name__) - -class general_ledger_webkit_wizard(orm.TransientModel): +class AccountReportGeneralLedgerWizard(models.TransientModel): _inherit = 'general.ledger.webkit' def xls_export(self, cr, uid, ids, context=None): @@ -40,5 +19,5 @@ class general_ledger_webkit_wizard(orm.TransientModel): 'report_name': 'account.account_report_general_ledger_xls', 'datas': data} else: - return super(general_ledger_webkit_wizard, self)._print_report( + return super(AccountReportGeneralLedgerWizard, self)._print_report( cr, uid, ids, data, context=context) diff --git a/account_financial_report_webkit_xls/wizard/general_ledger_wizard_view.xml b/account_financial_report_webkit_xls/wizard/general_ledger_wizard_view.xml index 1ab4f6ca..8eb805db 100644 --- a/account_financial_report_webkit_xls/wizard/general_ledger_wizard_view.xml +++ b/account_financial_report_webkit_xls/wizard/general_ledger_wizard_view.xml @@ -2,23 +2,21 @@ - + general.ledger.webkit.xls general.ledger.webkit form - - - - - 6 - - - + + + + 6 + + diff --git a/account_financial_report_webkit_xls/wizard/open_invoices_wizard.py b/account_financial_report_webkit_xls/wizard/open_invoices_wizard.py index dcc339c4..5b4b4df6 100644 --- a/account_financial_report_webkit_xls/wizard/open_invoices_wizard.py +++ b/account_financial_report_webkit_xls/wizard/open_invoices_wizard.py @@ -1,31 +1,10 @@ -# -*- 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). +from openerp import models -from openerp.osv import orm -# import logging -# _logger = logging.getLogger(__name__) - -class open_invoices_webkit_wizard(orm.TransientModel): +class AccountReportOpenInvoicesWizard(models.TransientModel): _inherit = 'open.invoices.webkit' def xls_export(self, cr, uid, ids, context=None): @@ -40,5 +19,5 @@ class open_invoices_webkit_wizard(orm.TransientModel): 'report_name': 'account.account_report_open_invoices_xls', 'datas': data} else: - return super(open_invoices_webkit_wizard, self)._print_report( + return super(AccountReportOpenInvoicesWizard, self)._print_report( cr, uid, ids, data, context=context) diff --git a/account_financial_report_webkit_xls/wizard/open_invoices_wizard_view.xml b/account_financial_report_webkit_xls/wizard/open_invoices_wizard_view.xml index 2d089239..c73e1346 100644 --- a/account_financial_report_webkit_xls/wizard/open_invoices_wizard_view.xml +++ b/account_financial_report_webkit_xls/wizard/open_invoices_wizard_view.xml @@ -2,23 +2,21 @@ - + open.invoices.webkit.xls open.invoices.webkit form - - - - - 6 - - - + + + + 6 + + diff --git a/account_financial_report_webkit_xls/wizard/partners_balance_wizard.py b/account_financial_report_webkit_xls/wizard/partners_balance_wizard.py index 27fc1ae7..3c0d6faf 100644 --- a/account_financial_report_webkit_xls/wizard/partners_balance_wizard.py +++ b/account_financial_report_webkit_xls/wizard/partners_balance_wizard.py @@ -1,31 +1,10 @@ -# -*- 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). +from openerp import models -from openerp.osv import orm -# import logging -# _logger = logging.getLogger(__name__) - -class partner_balance_wizard(orm.TransientModel): +class AccountPartnerBalanceWizard(models.TransientModel): _inherit = 'partner.balance.webkit' def xls_export(self, cr, uid, ids, context=None): @@ -41,5 +20,5 @@ class partner_balance_wizard(orm.TransientModel): 'report_name': 'account.account_report_partner_balance_xls', 'datas': data} else: - return super(partner_balance_wizard, self)._print_report( + return super(AccountPartnerBalanceWizard, self)._print_report( cr, uid, ids, data, context=context) diff --git a/account_financial_report_webkit_xls/wizard/partners_balance_wizard_view.xml b/account_financial_report_webkit_xls/wizard/partners_balance_wizard_view.xml index 7dbd6cca..d6a00f98 100644 --- a/account_financial_report_webkit_xls/wizard/partners_balance_wizard_view.xml +++ b/account_financial_report_webkit_xls/wizard/partners_balance_wizard_view.xml @@ -1,24 +1,22 @@ - - + + partner.balance.webkit.xls partner.balance.webkit form - - - - - 6 - - - + + + + 6 + + diff --git a/account_financial_report_webkit_xls/wizard/partners_ledger_wizard.py b/account_financial_report_webkit_xls/wizard/partners_ledger_wizard.py index 27057c6d..450bbfab 100644 --- a/account_financial_report_webkit_xls/wizard/partners_ledger_wizard.py +++ b/account_financial_report_webkit_xls/wizard/partners_ledger_wizard.py @@ -1,31 +1,10 @@ -# -*- 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). +from openerp import models -from openerp.osv import orm -# import logging -# _logger = logging.getLogger(__name__) - -class partner_ledger_webkit_wizard(orm.TransientModel): +class AccountReportPartnersLedgerWizard(models.TransientModel): _inherit = 'partners.ledger.webkit' def xls_export(self, cr, uid, ids, context=None): @@ -36,9 +15,11 @@ class partner_ledger_webkit_wizard(orm.TransientModel): if context.get('xls_export'): # we update form with display account value data = self.pre_print_report(cr, uid, ids, data, context=context) - return {'type': 'ir.actions.report.xml', - 'report_name': 'account.account_report_partner_ledger_xls', - 'datas': data} + return { + 'type': 'ir.actions.report.xml', + 'report_name': 'account.account_report_partner_ledger_xls', + 'datas': data} else: - return super(partner_ledger_webkit_wizard, self)._print_report( + return super( + AccountReportPartnersLedgerWizard, self)._print_report( cr, uid, ids, data, context=context) diff --git a/account_financial_report_webkit_xls/wizard/partners_ledger_wizard_view.xml b/account_financial_report_webkit_xls/wizard/partners_ledger_wizard_view.xml index 3015eb82..a1c2f18e 100644 --- a/account_financial_report_webkit_xls/wizard/partners_ledger_wizard_view.xml +++ b/account_financial_report_webkit_xls/wizard/partners_ledger_wizard_view.xml @@ -2,23 +2,21 @@ - + partners.ledger.webkit.xls partners.ledger.webkit form - - - - - 6 - - - + + + + 6 + + diff --git a/account_financial_report_webkit_xls/wizard/trial_balance_wizard.py b/account_financial_report_webkit_xls/wizard/trial_balance_wizard.py index 7f4ecd41..77965ba1 100644 --- a/account_financial_report_webkit_xls/wizard/trial_balance_wizard.py +++ b/account_financial_report_webkit_xls/wizard/trial_balance_wizard.py @@ -1,31 +1,10 @@ -# -*- 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). +from openerp import models -from openerp.osv import orm -# import logging -# _logger = logging.getLogger(__name__) - -class trial_balance_wizard(orm.TransientModel): +class AccountTrialBalanceWizard(models.TransientModel): _inherit = 'trial.balance.webkit' def xls_export(self, cr, uid, ids, context=None): @@ -40,5 +19,5 @@ class trial_balance_wizard(orm.TransientModel): 'report_name': 'account.account_report_trial_balance_xls', 'datas': data} else: - return super(trial_balance_wizard, self)._print_report( + return super(AccountTrialBalanceWizard, self)._print_report( cr, uid, ids, data, context=context) diff --git a/account_financial_report_webkit_xls/wizard/trial_balance_wizard_view.xml b/account_financial_report_webkit_xls/wizard/trial_balance_wizard_view.xml index f7d16633..cd0cd345 100644 --- a/account_financial_report_webkit_xls/wizard/trial_balance_wizard_view.xml +++ b/account_financial_report_webkit_xls/wizard/trial_balance_wizard_view.xml @@ -1,24 +1,22 @@ - - + + trial.balance.webkit.xls trial.balance.webkit form - - - - - 6 - - - + + + + 6 + +