Browse Source

[MIG] account_financial_report_horizontal: Migration to 11.0

pull/605/head
mreficent 5 years ago
parent
commit
fd65347744
  1. 8
      account_financial_report_horizontal/README.rst
  2. 3
      account_financial_report_horizontal/__init__.py
  3. 5
      account_financial_report_horizontal/__manifest__.py
  4. 2
      account_financial_report_horizontal/data/ir_actions_report_xml.xml
  5. 2
      account_financial_report_horizontal/i18n/account_financial_report_horizontal.pot
  6. 1
      account_financial_report_horizontal/models/__init__.py
  7. 1
      account_financial_report_horizontal/models/account_financial_report.py
  8. 1
      account_financial_report_horizontal/report/__init__.py
  9. 5
      account_financial_report_horizontal/report/report_financial.py
  10. 6
      account_financial_report_horizontal/report/report_financial.xml
  11. 1
      account_financial_report_horizontal/tests/__init__.py
  12. 10
      account_financial_report_horizontal/tests/test_account_financial_report_horizontal.py

8
account_financial_report_horizontal/README.rst

@ -1,5 +1,5 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:target: http://www.gnu.org/licenses/agpl
.. image:: https://img.shields.io/badge/license-AGPL--3-blue.png
:target: https://www.gnu.org/licenses/agpl
:alt: License: AGPL-3 :alt: License: AGPL-3
====================================== ======================================
@ -18,7 +18,7 @@ will be in landscape mode with assets left and liabilities right.
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot :alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/91/10.0
:target: https://runbot.odoo-community.org/runbot/91/11.0
Bug Tracker Bug Tracker
=========== ===========
@ -34,7 +34,7 @@ Credits
Images Images
------ ------
* Odoo Community Association: `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_.
* Odoo Community Association: `Icon <https://odoo-community.org/logo.png>`_.
Contributors Contributors
------------ ------------

3
account_financial_report_horizontal/__init__.py

@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import report
from . import models from . import models
from . import report

5
account_financial_report_horizontal/__manifest__.py

@ -1,16 +1,15 @@
# -*- coding: utf-8 -*-
# © 2012-2016 Therp BV <http://therp.nl> # © 2012-2016 Therp BV <http://therp.nl>
# © 2013 Agile Business Group sagl <http://www.agilebg.com> # © 2013 Agile Business Group sagl <http://www.agilebg.com>
# <lorenzo.battistini@agilebg.com> # <lorenzo.battistini@agilebg.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{ {
"name": "Accounting Financial Report Horizontal", "name": "Accounting Financial Report Horizontal",
"version": "10.0.1.0.0",
"version": "11.0.1.0.0",
"author": "Therp BV,Agile Business Group,Odoo Community Association (OCA)", "author": "Therp BV,Agile Business Group,Odoo Community Association (OCA)",
"category": 'Accounting & Finance', "category": 'Accounting & Finance',
'website': 'https://github.com/OCA/account-financial-reporting', 'website': 'https://github.com/OCA/account-financial-reporting',
'license': 'AGPL-3', 'license': 'AGPL-3',
"depends": ["account"],
"depends": ["account_invoicing"],
'data': [ 'data': [
"data/report_paperformat.xml", "data/report_paperformat.xml",
"data/ir_actions_report_xml.xml", "data/ir_actions_report_xml.xml",

2
account_financial_report_horizontal/data/ir_actions_report_xml.xml

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<odoo> <odoo>
<record id="account.action_report_financial" model="ir.actions.report.xml">
<record id="account.action_report_financial" model="ir.actions.report">
<field name="paperformat_id" ref="paperformat_euro_landscape" /> <field name="paperformat_id" ref="paperformat_euro_landscape" />
</record> </record>
</odoo> </odoo>

2
account_financial_report_horizontal/i18n/account_financial_report_horizontal.pot

@ -4,7 +4,7 @@
# #
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Project-Id-Version: Odoo Server 11.0\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"Last-Translator: <>\n" "Last-Translator: <>\n"
"Language-Team: \n" "Language-Team: \n"

1
account_financial_report_horizontal/models/__init__.py

@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# © 2015 Therp BV <http://therp.nl> # © 2015 Therp BV <http://therp.nl>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import account_financial_report from . import account_financial_report

1
account_financial_report_horizontal/models/account_financial_report.py

@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# © 2015 Therp BV <http://therp.nl> # © 2015 Therp BV <http://therp.nl>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import api, models from odoo import api, models

1
account_financial_report_horizontal/report/__init__.py

@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# © 2015 Therp BV <http://therp.nl> # © 2015 Therp BV <http://therp.nl>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import report_financial from . import report_financial

5
account_financial_report_horizontal/report/report_financial.py

@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# © 2016 Therp BV <http://therp.nl> # © 2016 Therp BV <http://therp.nl>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import api, models from odoo import api, models
@ -21,9 +20,9 @@ class ReportFinancial(models.AbstractModel):
return self.get_account_lines(data, side='right') return self.get_account_lines(data, side='right')
@api.multi @api.multi
def render_html(self, docids, data):
def get_report_values(self, docids, data):
data.setdefault('form', {}).update( data.setdefault('form', {}).update(
get_left_lines=self.get_left_lines, get_left_lines=self.get_left_lines,
get_right_lines=self.get_right_lines, get_right_lines=self.get_right_lines,
) )
return super(ReportFinancial, self).render_html(docids, data)
return super(ReportFinancial, self).get_report_values(docids, data)

6
account_financial_report_horizontal/report/report_financial.xml

@ -3,11 +3,11 @@
<template id="report_financial" inherit_id="account.report_financial"> <template id="report_financial" inherit_id="account.report_financial">
<!-- replace all tables for different selections and do it in one table /--> <!-- replace all tables for different selections and do it in one table /-->
<!-- with credit/debit /--> <!-- with credit/debit /-->
<xpath expr="//div[@class='page']/table" position="replace" />
<xpath expr="//div[hasclass('page')]/table" position="replace" />
<!-- unfiltered without credit/debit /--> <!-- unfiltered without credit/debit /-->
<xpath expr="//div[@class='page']/table" position="replace" />
<xpath expr="//div[hasclass('page')]/table" position="replace" />
<!-- filtered without credit/debit /--> <!-- filtered without credit/debit /-->
<xpath expr="//div[@class='page']/table" position="replace">
<xpath expr="//div[hasclass('page')]/table" position="replace">
<div class="row"> <div class="row">
<div class="col-xs-6" t-foreach="[data['get_left_lines'], data['get_right_lines']]" t-as="get_lines_function"> <div class="col-xs-6" t-foreach="[data['get_left_lines'], data['get_right_lines']]" t-as="get_lines_function">
<table class="table table-condensed"> <table class="table table-condensed">

1
account_financial_report_horizontal/tests/__init__.py

@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# © 2016 Therp BV <http://therp.nl> # © 2016 Therp BV <http://therp.nl>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import test_account_financial_report_horizontal from . import test_account_financial_report_horizontal

10
account_financial_report_horizontal/tests/test_account_financial_report_horizontal.py

@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# © 2016 Therp BV <http://therp.nl> # © 2016 Therp BV <http://therp.nl>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from lxml import etree from lxml import etree
@ -12,9 +11,10 @@ class TestAccountFinancialReportHorizontal(TransactionCase):
active_model='ir.ui.view', active_model='ir.ui.view',
).create({}).check_report() ).create({}).check_report()
data = action['data'] data = action['data']
html = self.env['report'].with_context(action['context']).get_html(
report = self.env['ir.actions.report']._get_report_from_name(
action['report_name'])
html = report.with_context(action['context']).render_qweb_html(
self.env[data['model']].browse(data['ids']), self.env[data['model']].browse(data['ids']),
report_name=action['report_name'],
data=data, data=data,
)
self.assertTrue(etree.fromstring(html).xpath('//div[@class="row"]'))
)[0]
self.assertTrue(etree.fromstring(html).xpath("//div[hasclass('row')]"))
Loading…
Cancel
Save