[MIG] report_xml: Migration to 17.0

This commit is contained in:
Viktor Anikeenko
2023-12-07 16:11:11 +02:00
committed by Atte Isopuro
parent 6dd4fd321a
commit cefc885e07
4 changed files with 9 additions and 18 deletions

View File

@@ -2,7 +2,7 @@
# License AGPL-3.0 or later (https://www.gnuorg/licenses/agpl.html).
{
"name": "XML Reports",
"version": "16.0.1.1.1",
"version": "17.0.1.0.0",
"category": "Reporting",
"website": "https://github.com/OCA/reporting-engine",
"development_status": "Production/Stable",

View File

@@ -6,6 +6,8 @@
<field name="report_type">qweb-xml</field>
<field name="report_name">report_xml.demo_report_xml_view</field>
<field name="report_file">res_company</field>
<field name="binding_model_id" ref="base.model_res_company" />
<field name="binding_type">report</field>
<!--
In case of demo data next definition will not work. So it just example
how it should look. If report is a part of demo data you will need

View File

@@ -2,10 +2,8 @@
import os
from odoo import SUPERUSER_ID, api
def post_init_hook(cr, registry):
def post_init_hook(env):
"""
Loaded after installing this module, and before the next module starts
installing.
@@ -18,11 +16,8 @@ def post_init_hook(cr, registry):
to `xsd_schema` field for demo record only via hook.
Args:
* cr(odoo.sql_db.Cursor) - database cursor.
* registry(odoo.modules.registry.RegistryManager) - a mapping between
model names and model classes.
* env(odoo.api.Environment) - provides access to the models
"""
env = api.Environment(cr, SUPERUSER_ID, {})
report_domain = [
("report_name", "=", "report_xml.demo_report_xml_view") # report tech name
]

View File

@@ -6,21 +6,15 @@
<field name="inherit_id" ref="base.act_report_xml_view" />
<field name="arch" type="xml">
<button name="associated_view" position="attributes">
<attribute name="attrs">{
'invisible': [
('report_type', 'not in', ('qweb-pdf', 'qweb-html', 'qweb-text', 'qweb-xml')),
],
}</attribute>
<attribute name="invisible">
report_type not in ['qweb-pdf', 'qweb-html', 'qweb-text', 'qweb-xml']
</attribute>
</button>
<xpath expr="//page[@name='advanced']/group" position="after">
<group
name="xml_reports"
string="XML Rreport Settings"
attrs="{
'invisible': [
('report_type', '!=', 'qweb-xml')
],
}"
invisible="report_type != 'qweb-xml'"
>
<field name="xsd_schema" />
<field name="xml_encoding" />