[MIG] report_layout_config: Migration to 17.0

This commit is contained in:
Duy (Đỗ Anh)
2024-05-17 17:33:07 +07:00
parent c83845a387
commit cfe5f2dbfb
10 changed files with 21 additions and 40 deletions

View File

@@ -39,7 +39,7 @@ to replace header and footer.
Usage Usage
===== =====
- In Setting/General Setting/Business Documents: - In Setting/General Setting/Document Layout:
- Click on Configure Document Layout - Click on Configure Document Layout
- On the wizard choose Layout images - On the wizard choose Layout images
@@ -68,6 +68,7 @@ Contributors
- Thomas Nowicki <thomas.nowicki@camptocamp.com> - Thomas Nowicki <thomas.nowicki@camptocamp.com>
- Iryna Vyshnevska <iryna.vyshnevska@camptocamp.com> - Iryna Vyshnevska <iryna.vyshnevska@camptocamp.com>
- Do Anh Duy <duyda@trobz.com>
Maintainers Maintainers
----------- -----------

View File

@@ -4,7 +4,7 @@
{ {
"name": "Report layout configuration", "name": "Report layout configuration",
"summary": "Add possibility to easily modify the global report layout", "summary": "Add possibility to easily modify the global report layout",
"version": "14.0.1.0.1", "version": "17.0.1.0.0",
"category": "Reporting", "category": "Reporting",
"website": "https://github.com/OCA/reporting-engine", "website": "https://github.com/OCA/reporting-engine",
"author": "Camptocamp, " "Odoo Community Association (OCA)", "author": "Camptocamp, " "Odoo Community Association (OCA)",
@@ -12,10 +12,14 @@
"depends": ["web", "base"], "depends": ["web", "base"],
"data": [ "data": [
"views/document_layout.xml", "views/document_layout.xml",
"templates/assets.xml",
"templates/report_templates.xml", "templates/report_templates.xml",
"data/report_layout.xml", "data/report_layout.xml",
], ],
"assets": {
"web.report_assets_common": [
"/report_layout_config/static/src/scss/style.scss",
],
},
"application": False, "application": False,
"installable": True, "installable": True,
} }

View File

@@ -1,17 +0,0 @@
# Copyright 2021 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openupgradelib.openupgrade import rename_xmlids
def migrate(cr, version):
rename_xmlids(
cr,
[
(
"report_layout_config.external_layout_images",
"report_layout_config.external_standard_layout_images_template",
)
],
)

View File

@@ -23,4 +23,4 @@ class BaseDocumentLayout(models.TransientModel):
"full_header_img", "full_header_img",
) )
def _compute_preview(self): def _compute_preview(self):
super()._compute_preview() return super()._compute_preview()

View File

@@ -1,2 +1,3 @@
- Thomas Nowicki \<<thomas.nowicki@camptocamp.com>\> - Thomas Nowicki \<<thomas.nowicki@camptocamp.com>\>
- Iryna Vyshnevska \<<iryna.vyshnevska@camptocamp.com>\> - Iryna Vyshnevska \<<iryna.vyshnevska@camptocamp.com>\>
- Do Anh Duy \<<duyda@trobz.com>\>

View File

@@ -1,4 +1,4 @@
- In Setting/General Setting/Business Documents: - In Setting/General Setting/Document Layout:
- Click on Configure Document Layout - Click on Configure Document Layout
- On the wizard choose Layout images - On the wizard choose Layout images
- Set the Full header image + Full footer image - Set the Full header image + Full footer image

View File

@@ -388,7 +388,7 @@ to replace header and footer.</p>
<div class="section" id="usage"> <div class="section" id="usage">
<h1><a class="toc-backref" href="#toc-entry-1">Usage</a></h1> <h1><a class="toc-backref" href="#toc-entry-1">Usage</a></h1>
<ul class="simple"> <ul class="simple">
<li>In Setting/General Setting/Business Documents:<ul> <li>In Setting/General Setting/Document Layout:<ul>
<li>Click on Configure Document Layout</li> <li>Click on Configure Document Layout</li>
<li>On the wizard choose Layout images</li> <li>On the wizard choose Layout images</li>
<li>Set the Full header image + Full footer image</li> <li>Set the Full header image + Full footer image</li>
@@ -417,6 +417,7 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
<ul class="simple"> <ul class="simple">
<li>Thomas Nowicki &lt;<a class="reference external" href="mailto:thomas.nowicki&#64;camptocamp.com">thomas.nowicki&#64;camptocamp.com</a>&gt;</li> <li>Thomas Nowicki &lt;<a class="reference external" href="mailto:thomas.nowicki&#64;camptocamp.com">thomas.nowicki&#64;camptocamp.com</a>&gt;</li>
<li>Iryna Vyshnevska &lt;<a class="reference external" href="mailto:iryna.vyshnevska&#64;camptocamp.com">iryna.vyshnevska&#64;camptocamp.com</a>&gt;</li> <li>Iryna Vyshnevska &lt;<a class="reference external" href="mailto:iryna.vyshnevska&#64;camptocamp.com">iryna.vyshnevska&#64;camptocamp.com</a>&gt;</li>
<li>Do Anh Duy &lt;<a class="reference external" href="mailto:duyda&#64;trobz.com">duyda&#64;trobz.com</a>&gt;</li>
</ul> </ul>
</div> </div>
<div class="section" id="maintainers"> <div class="section" id="maintainers">

View File

@@ -1,14 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<template id="report_assets_common" inherit_id="web.report_assets_common">
<xpath expr="." position="inside">
<link
href="/report_layout_config/static/src/scss/style.scss"
rel="stylesheet"
type="text/scss"
/>
</xpath>
</template>
</odoo>

View File

@@ -45,7 +45,7 @@
<template <template
id="external_clean_layout_images_template" id="external_clean_layout_images_template"
primary="True" primary="True"
inherit_id="web.external_layout_clean" inherit_id="web.external_layout_bold"
priority="99" priority="99"
> >
<xpath expr="//div[contains(@t-attf-class, 'header')]" position="replace"> <xpath expr="//div[contains(@t-attf-class, 'header')]" position="replace">
@@ -105,7 +105,7 @@
} }
} }
</t> </t>
<!-- next part is the same as in web/views/report_templates web.external_layout_clean --> <!-- next part is the same as in web/views/report_templates web.external_layout_bold -->
<t <t
t-elif="layout == 'report_layout_config.external_clean_layout_images_template'" t-elif="layout == 'report_layout_config.external_clean_layout_images_template'"
> >

View File

@@ -10,7 +10,12 @@
<field name="full_footer_img" widget="image" class="mb-4" /> <field name="full_footer_img" widget="image" class="mb-4" />
</xpath> </xpath>
<field name="preview" position="attributes"> <field name="preview" position="attributes">
<attribute name='style'>max-width: 450px;</attribute> <attribute name='style'>
max-width: 450px;
display: flex;
align-items: center;
justify-content: center;
</attribute>
</field> </field>
</field> </field>
</record> </record>