Browse Source

[MIG] report_qweb_parameter: Migration to 14.0

myc-14.0-py3o
Francisco Ivan Anton Prieto 4 years ago
parent
commit
0c232de398
  1. 2
      report_qweb_parameter/README.rst
  2. 2
      report_qweb_parameter/__manifest__.py
  3. 13
      report_qweb_parameter/demo/test_report_field_length.xml
  4. 2
      report_qweb_parameter/readme/CONTRIBUTORS.rst
  5. 10
      report_qweb_parameter/tests/test_report_qweb_parameter.py

2
report_qweb_parameter/README.rst

@ -72,6 +72,8 @@ Contributors
* Carlos Roca * Carlos Roca
* Iván Antón <ozono@ozonomultimedia.com>
Maintainers Maintainers
~~~~~~~~~~~ ~~~~~~~~~~~

2
report_qweb_parameter/__manifest__.py

@ -3,7 +3,7 @@
{ {
"name": "Report QWeb Parameter", "name": "Report QWeb Parameter",
"version": "13.0.1.0.0",
"version": "14.0.1.0.0",
"license": "AGPL-3", "license": "AGPL-3",
"summary": """ "summary": """
Add new parameters for qweb templates in order to reduce field length Add new parameters for qweb templates in order to reduce field length

13
report_qweb_parameter/demo/test_report_field_length.xml

@ -1,12 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<odoo> <odoo>
<report
id="test_report_length_report_id"
model="res.company"
string="Length Report"
report_type="qweb-html"
name="report_qweb_parameter.test_report_length"
/>
<record id="test_report_length_report_id" model="ir.actions.report">
<field name="name">Length Report</field>
<field name="model">res.company</field>
<field name="report_type">qweb-html</field>
<field name="report_name">report_qweb_parameter.test_report_length</field>
</record>
<template id="test_report_length"> <template id="test_report_length">
<data> <data>
<li <li

2
report_qweb_parameter/readme/CONTRIBUTORS.rst

@ -3,3 +3,5 @@
* `Tecnativa <https://www.tecnativa.com>`_: * `Tecnativa <https://www.tecnativa.com>`_:
* Carlos Roca * Carlos Roca
* Iván Antón <ozono@ozonomultimedia.com>

10
report_qweb_parameter/tests/test_report_qweb_parameter.py

@ -22,19 +22,19 @@ class TestReportQWebParameter(common.TransactionCase):
} }
) )
docs.website = "1234567890" # for avoding that Odoo adds http:// docs.website = "1234567890" # for avoding that Odoo adds http://
rep = report_object.render(docs.ids, False)
rep = report_object._render(docs.ids, False)
root = ET.fromstring(rep[0]) root = ET.fromstring(rep[0])
self.assertEqual(root[0].text, "1234567890") self.assertEqual(root[0].text, "1234567890")
self.assertEqual(root[2].text, "1234567890") self.assertEqual(root[2].text, "1234567890")
docs.update({"street": "123456789"}) docs.update({"street": "123456789"})
with self.assertRaises(QWebException): with self.assertRaises(QWebException):
report_object.render(docs.ids, False)
report_object._render(docs.ids, False)
docs.update({"street": "1234567890", "vat": "123456789"}) docs.update({"street": "1234567890", "vat": "123456789"})
with self.assertRaises(QWebException): with self.assertRaises(QWebException):
report_object.render(docs.ids, False)
report_object._render(docs.ids, False)
docs.update({"vat": "1234567890", "website": "12345678901"}) docs.update({"vat": "1234567890", "website": "12345678901"})
with self.assertRaises(QWebException): with self.assertRaises(QWebException):
report_object.render(docs.ids, False)
report_object._render(docs.ids, False)
docs.update({"website": "1234567890", "company_registry": "12345678901"}) docs.update({"website": "1234567890", "company_registry": "12345678901"})
with self.assertRaises(QWebException): with self.assertRaises(QWebException):
report_object.render(docs.ids, False)
report_object._render(docs.ids, False)
Loading…
Cancel
Save