Browse Source
Merge pull request #341 from Eficent/10.0-mig-account_financial_report_horizontal
Merge pull request #341 from Eficent/10.0-mig-account_financial_report_horizontal
[10.0][MIG] account_financial_report_horizontalpull/339/merge
Pedro M. Baeza
7 years ago
committed by
GitHub
17 changed files with 362 additions and 151 deletions
-
36account_financial_report_horizontal/README.rst
-
2account_financial_report_horizontal/__init__.py
-
33account_financial_report_horizontal/__manifest__.py
-
6account_financial_report_horizontal/data/ir_actions_report_xml.xml
-
6account_financial_report_horizontal/data/report_paperformat.xml
-
49account_financial_report_horizontal/i18n/ca.po
-
49account_financial_report_horizontal/i18n/de.po
-
49account_financial_report_horizontal/i18n/es.po
-
49account_financial_report_horizontal/i18n/fr.po
-
49account_financial_report_horizontal/i18n/pt.po
-
21account_financial_report_horizontal/models/__init__.py
-
46account_financial_report_horizontal/models/account_financial_report.py
-
3account_financial_report_horizontal/report/__init__.py
-
65account_financial_report_horizontal/report/report_financial.py
-
26account_financial_report_horizontal/report/report_financial.xml
-
4account_financial_report_horizontal/tests/__init__.py
-
20account_financial_report_horizontal/tests/test_account_financial_report_horizontal.py
@ -1,2 +1,4 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
|||
from . import report |
|||
from . import models |
@ -1,8 +1,6 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<openerp> |
|||
<data> |
|||
<odoo> |
|||
<record id="account.action_report_financial" model="ir.actions.report.xml"> |
|||
<field name="paperformat_id" ref="paperformat_euro_landscape" /> |
|||
</record> |
|||
</data> |
|||
</openerp> |
|||
</odoo> |
@ -0,0 +1,49 @@ |
|||
# Translation of Odoo Server. |
|||
# This file contains the translation of the following modules: |
|||
# * account_financial_report_horizontal |
|||
# |
|||
# Translators: |
|||
# Marc Tormo i Bochaca <mtbochaca@gmail.com>, 2017 |
|||
msgid "" |
|||
msgstr "" |
|||
"Project-Id-Version: Odoo Server 9.0c\n" |
|||
"Report-Msgid-Bugs-To: \n" |
|||
"POT-Creation-Date: 2017-04-26 02:44+0000\n" |
|||
"PO-Revision-Date: 2017-04-26 02:44+0000\n" |
|||
"Last-Translator: Marc Tormo i Bochaca <mtbochaca@gmail.com>, 2017\n" |
|||
"Language-Team: Catalan (https://www.transifex.com/oca/teams/23907/ca/)\n" |
|||
"MIME-Version: 1.0\n" |
|||
"Content-Type: text/plain; charset=UTF-8\n" |
|||
"Content-Transfer-Encoding: \n" |
|||
"Language: ca\n" |
|||
"Plural-Forms: nplurals=2; plural=(n != 1);\n" |
|||
|
|||
#. module: account_financial_report_horizontal |
|||
#: model:ir.model,name:account_financial_report_horizontal.model_account_financial_report |
|||
msgid "Account Report" |
|||
msgstr "Informe Comptable " |
|||
|
|||
#. module: account_financial_report_horizontal |
|||
#: model:ir.ui.view,arch_db:account_financial_report_horizontal.report_financial |
|||
msgid "Balance" |
|||
msgstr "Balanç " |
|||
|
|||
#. module: account_financial_report_horizontal |
|||
#: model:ir.ui.view,arch_db:account_financial_report_horizontal.report_financial |
|||
msgid "Credit" |
|||
msgstr "Crèdit " |
|||
|
|||
#. module: account_financial_report_horizontal |
|||
#: model:ir.ui.view,arch_db:account_financial_report_horizontal.report_financial |
|||
msgid "Debit" |
|||
msgstr "Dèbit " |
|||
|
|||
#. module: account_financial_report_horizontal |
|||
#: model:ir.ui.view,arch_db:account_financial_report_horizontal.report_financial |
|||
msgid "Name" |
|||
msgstr "Nom" |
|||
|
|||
#. module: account_financial_report_horizontal |
|||
#: model:ir.model,name:account_financial_report_horizontal.model_report_account_report_financial |
|||
msgid "report.account.report_financial" |
|||
msgstr "report.account.report_financial" |
@ -0,0 +1,49 @@ |
|||
# Translation of Odoo Server. |
|||
# This file contains the translation of the following modules: |
|||
# * account_financial_report_horizontal |
|||
# |
|||
# Translators: |
|||
# OCA Transbot <transbot@odoo-community.org>, 2017 |
|||
msgid "" |
|||
msgstr "" |
|||
"Project-Id-Version: Odoo Server 9.0c\n" |
|||
"Report-Msgid-Bugs-To: \n" |
|||
"POT-Creation-Date: 2017-01-20 12:49+0000\n" |
|||
"PO-Revision-Date: 2017-01-20 12:49+0000\n" |
|||
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2017\n" |
|||
"Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n" |
|||
"MIME-Version: 1.0\n" |
|||
"Content-Type: text/plain; charset=UTF-8\n" |
|||
"Content-Transfer-Encoding: \n" |
|||
"Language: de\n" |
|||
"Plural-Forms: nplurals=2; plural=(n != 1);\n" |
|||
|
|||
#. module: account_financial_report_horizontal |
|||
#: model:ir.model,name:account_financial_report_horizontal.model_account_financial_report |
|||
msgid "Account Report" |
|||
msgstr "" |
|||
|
|||
#. module: account_financial_report_horizontal |
|||
#: model:ir.ui.view,arch_db:account_financial_report_horizontal.report_financial |
|||
msgid "Balance" |
|||
msgstr "" |
|||
|
|||
#. module: account_financial_report_horizontal |
|||
#: model:ir.ui.view,arch_db:account_financial_report_horizontal.report_financial |
|||
msgid "Credit" |
|||
msgstr "Kredit" |
|||
|
|||
#. module: account_financial_report_horizontal |
|||
#: model:ir.ui.view,arch_db:account_financial_report_horizontal.report_financial |
|||
msgid "Debit" |
|||
msgstr "Soll" |
|||
|
|||
#. module: account_financial_report_horizontal |
|||
#: model:ir.ui.view,arch_db:account_financial_report_horizontal.report_financial |
|||
msgid "Name" |
|||
msgstr "Name" |
|||
|
|||
#. module: account_financial_report_horizontal |
|||
#: model:ir.model,name:account_financial_report_horizontal.model_report_account_report_financial |
|||
msgid "report.account.report_financial" |
|||
msgstr "" |
@ -0,0 +1,49 @@ |
|||
# Translation of Odoo Server. |
|||
# This file contains the translation of the following modules: |
|||
# * account_financial_report_horizontal |
|||
# |
|||
# Translators: |
|||
# Pedro M. Baeza <pedro.baeza@gmail.com>, 2016 |
|||
msgid "" |
|||
msgstr "" |
|||
"Project-Id-Version: Odoo Server 9.0c\n" |
|||
"Report-Msgid-Bugs-To: \n" |
|||
"POT-Creation-Date: 2016-12-16 12:30+0000\n" |
|||
"PO-Revision-Date: 2016-12-16 12:30+0000\n" |
|||
"Last-Translator: Pedro M. Baeza <pedro.baeza@gmail.com>, 2016\n" |
|||
"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n" |
|||
"MIME-Version: 1.0\n" |
|||
"Content-Type: text/plain; charset=UTF-8\n" |
|||
"Content-Transfer-Encoding: \n" |
|||
"Language: es\n" |
|||
"Plural-Forms: nplurals=2; plural=(n != 1);\n" |
|||
|
|||
#. module: account_financial_report_horizontal |
|||
#: model:ir.model,name:account_financial_report_horizontal.model_account_financial_report |
|||
msgid "Account Report" |
|||
msgstr "Informe de cuentas" |
|||
|
|||
#. module: account_financial_report_horizontal |
|||
#: model:ir.ui.view,arch_db:account_financial_report_horizontal.report_financial |
|||
msgid "Balance" |
|||
msgstr "Saldo" |
|||
|
|||
#. module: account_financial_report_horizontal |
|||
#: model:ir.ui.view,arch_db:account_financial_report_horizontal.report_financial |
|||
msgid "Credit" |
|||
msgstr "Haber" |
|||
|
|||
#. module: account_financial_report_horizontal |
|||
#: model:ir.ui.view,arch_db:account_financial_report_horizontal.report_financial |
|||
msgid "Debit" |
|||
msgstr "Debe" |
|||
|
|||
#. module: account_financial_report_horizontal |
|||
#: model:ir.ui.view,arch_db:account_financial_report_horizontal.report_financial |
|||
msgid "Name" |
|||
msgstr "Nombre" |
|||
|
|||
#. module: account_financial_report_horizontal |
|||
#: model:ir.model,name:account_financial_report_horizontal.model_report_account_report_financial |
|||
msgid "report.account.report_financial" |
|||
msgstr "report.account.report_financial" |
@ -0,0 +1,49 @@ |
|||
# Translation of Odoo Server. |
|||
# This file contains the translation of the following modules: |
|||
# * account_financial_report_horizontal |
|||
# |
|||
# Translators: |
|||
# OCA Transbot <transbot@odoo-community.org>, 2016 |
|||
msgid "" |
|||
msgstr "" |
|||
"Project-Id-Version: Odoo Server 9.0c\n" |
|||
"Report-Msgid-Bugs-To: \n" |
|||
"POT-Creation-Date: 2016-12-16 12:30+0000\n" |
|||
"PO-Revision-Date: 2016-12-16 12:30+0000\n" |
|||
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2016\n" |
|||
"Language-Team: French (https://www.transifex.com/oca/teams/23907/fr/)\n" |
|||
"MIME-Version: 1.0\n" |
|||
"Content-Type: text/plain; charset=UTF-8\n" |
|||
"Content-Transfer-Encoding: \n" |
|||
"Language: fr\n" |
|||
"Plural-Forms: nplurals=2; plural=(n > 1);\n" |
|||
|
|||
#. module: account_financial_report_horizontal |
|||
#: model:ir.model,name:account_financial_report_horizontal.model_account_financial_report |
|||
msgid "Account Report" |
|||
msgstr "" |
|||
|
|||
#. module: account_financial_report_horizontal |
|||
#: model:ir.ui.view,arch_db:account_financial_report_horizontal.report_financial |
|||
msgid "Balance" |
|||
msgstr "" |
|||
|
|||
#. module: account_financial_report_horizontal |
|||
#: model:ir.ui.view,arch_db:account_financial_report_horizontal.report_financial |
|||
msgid "Credit" |
|||
msgstr "Crédit" |
|||
|
|||
#. module: account_financial_report_horizontal |
|||
#: model:ir.ui.view,arch_db:account_financial_report_horizontal.report_financial |
|||
msgid "Debit" |
|||
msgstr "Débit" |
|||
|
|||
#. module: account_financial_report_horizontal |
|||
#: model:ir.ui.view,arch_db:account_financial_report_horizontal.report_financial |
|||
msgid "Name" |
|||
msgstr "Nom" |
|||
|
|||
#. module: account_financial_report_horizontal |
|||
#: model:ir.model,name:account_financial_report_horizontal.model_report_account_report_financial |
|||
msgid "report.account.report_financial" |
|||
msgstr "" |
@ -0,0 +1,49 @@ |
|||
# Translation of Odoo Server. |
|||
# This file contains the translation of the following modules: |
|||
# * account_financial_report_horizontal |
|||
# |
|||
# Translators: |
|||
# Pedro Castro Silva <pedrocs@sossia.pt>, 2017 |
|||
msgid "" |
|||
msgstr "" |
|||
"Project-Id-Version: Odoo Server 9.0c\n" |
|||
"Report-Msgid-Bugs-To: \n" |
|||
"POT-Creation-Date: 2017-05-01 13:13+0000\n" |
|||
"PO-Revision-Date: 2017-05-01 13:13+0000\n" |
|||
"Last-Translator: Pedro Castro Silva <pedrocs@sossia.pt>, 2017\n" |
|||
"Language-Team: Portuguese (https://www.transifex.com/oca/teams/23907/pt/)\n" |
|||
"MIME-Version: 1.0\n" |
|||
"Content-Type: text/plain; charset=UTF-8\n" |
|||
"Content-Transfer-Encoding: \n" |
|||
"Language: pt\n" |
|||
"Plural-Forms: nplurals=2; plural=(n != 1);\n" |
|||
|
|||
#. module: account_financial_report_horizontal |
|||
#: model:ir.model,name:account_financial_report_horizontal.model_account_financial_report |
|||
msgid "Account Report" |
|||
msgstr "" |
|||
|
|||
#. module: account_financial_report_horizontal |
|||
#: model:ir.ui.view,arch_db:account_financial_report_horizontal.report_financial |
|||
msgid "Balance" |
|||
msgstr "" |
|||
|
|||
#. module: account_financial_report_horizontal |
|||
#: model:ir.ui.view,arch_db:account_financial_report_horizontal.report_financial |
|||
msgid "Credit" |
|||
msgstr "" |
|||
|
|||
#. module: account_financial_report_horizontal |
|||
#: model:ir.ui.view,arch_db:account_financial_report_horizontal.report_financial |
|||
msgid "Debit" |
|||
msgstr "" |
|||
|
|||
#. module: account_financial_report_horizontal |
|||
#: model:ir.ui.view,arch_db:account_financial_report_horizontal.report_financial |
|||
msgid "Name" |
|||
msgstr "Nome" |
|||
|
|||
#. module: account_financial_report_horizontal |
|||
#: model:ir.model,name:account_financial_report_horizontal.model_report_account_report_financial |
|||
msgid "report.account.report_financial" |
|||
msgstr "" |
@ -1,21 +1,4 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################## |
|||
# |
|||
# OpenERP, Open Source Management Solution |
|||
# This module copyright (C) 2015 Therp BV (<http://therp.nl>). |
|||
# |
|||
# 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 <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################## |
|||
# © 2015 Therp BV <http://therp.nl> |
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
|||
from . import account_financial_report |
@ -1 +1,4 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# © 2015 Therp BV <http://therp.nl> |
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
|||
from . import report_financial |
@ -1,54 +1,29 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################## |
|||
# |
|||
# OpenERP, Open Source Management Solution |
|||
# This module copyright (C) 2015 Therp BV (<http://therp.nl>). |
|||
# |
|||
# 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 <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################## |
|||
import copy |
|||
from openerp import models |
|||
from openerp.addons.account.report.account_financial_report import\ |
|||
report_account_common |
|||
# © 2016 Therp BV <http://therp.nl> |
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
|||
from odoo import api, models |
|||
|
|||
|
|||
class report_account_common_horizontal(report_account_common): |
|||
def __init__(self, cr, uid, name, context=None): |
|||
super(report_account_common_horizontal, self).__init__( |
|||
cr, uid, name, context=context) |
|||
self.localcontext.update({ |
|||
'get_left_lines': self.get_left_lines, |
|||
'get_right_lines': self.get_right_lines, |
|||
}) |
|||
class ReportFinancial(models.AbstractModel): |
|||
_inherit = 'report.account.report_financial' |
|||
|
|||
def get_lines(self, data, side=None): |
|||
data = copy.deepcopy(data) |
|||
if data['form']['used_context'] is None: |
|||
data['form']['used_context'] = {} |
|||
data['form']['used_context'].update( |
|||
account_financial_report_horizontal_side=side) |
|||
return super(report_account_common_horizontal, self).get_lines( |
|||
data) |
|||
def get_account_lines(self, data, side=None): |
|||
return super( |
|||
ReportFinancial, self.with_context( |
|||
account_financial_report_horizontal_side=side, |
|||
) |
|||
).get_account_lines(data) |
|||
|
|||
def get_left_lines(self, data): |
|||
return self.get_lines(data, side='left') |
|||
return self.get_account_lines(data, side='left') |
|||
|
|||
def get_right_lines(self, data): |
|||
return self.get_lines(data, side='right') |
|||
|
|||
return self.get_account_lines(data, side='right') |
|||
|
|||
class ReportFinancial(models.AbstractModel): |
|||
_inherit = 'report.account.report_financial' |
|||
_wrapped_report_class = report_account_common_horizontal |
|||
@api.multi |
|||
def render_html(self, docids, data): |
|||
data.setdefault('form', {}).update( |
|||
get_left_lines=self.get_left_lines, |
|||
get_right_lines=self.get_right_lines, |
|||
) |
|||
return super(ReportFinancial, self).render_html(docids, data) |
@ -0,0 +1,4 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# © 2016 Therp BV <http://therp.nl> |
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
|||
from . import test_account_financial_report_horizontal |
@ -0,0 +1,20 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# © 2016 Therp BV <http://therp.nl> |
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
|||
from lxml import etree |
|||
from odoo.tests.common import TransactionCase |
|||
|
|||
|
|||
class TestAccountFinancialReportHorizontal(TransactionCase): |
|||
def test_account_financial_report_horizontal(self): |
|||
action = self.env['accounting.report'].with_context( |
|||
active_id=self.env.ref('account.menu_account_report_pl').id, |
|||
active_model='ir.ui.view', |
|||
).create({}).check_report() |
|||
data = action['data'] |
|||
html = self.env['report'].with_context(action['context']).get_html( |
|||
self.env[data['model']].browse(data['ids']), |
|||
report_name=action['report_name'], |
|||
data=data, |
|||
) |
|||
self.assertTrue(etree.fromstring(html).xpath('//div[@class="row"]')) |
Write
Preview
Loading…
Cancel
Save
Reference in new issue