Skip to content

Commit 8cf8c97

Browse files
committed
[MIG] report_label: Migration to 18.0
1 parent e07523d commit 8cf8c97

File tree

11 files changed

+76
-104
lines changed

11 files changed

+76
-104
lines changed

report_label/README.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Configuration
4646

4747
You should reuse or create a Paperformat.
4848

49-
|image|
49+
|conf_image_1|
5050

5151
**Configure your Server action**
5252

@@ -60,34 +60,34 @@ Create your label report :
6060
- In the 'Label Qweb Template' create or reuse a QWeb template for your
6161
label.
6262

63-
|image1|
63+
|conf_image_2|
6464

6565
**Importante Note**
6666

6767
`By
6868
design <https://github.com/OCA/reporting-engine/blob/14.0/report_label/reports/report_label.xml#L34>`__,
6969
the variable used in this QWeb template must be named record.
7070

71-
.. |image| image:: https://raw.githubusercontent.com/OCA/reporting-engine/18.0/report_label/static/description/report_paperformat_label_form.png
72-
.. |image1| image:: https://raw.githubusercontent.com/OCA/reporting-engine/18.0/report_label/static/description/ir_actions_server.png
71+
.. |conf_image_1| image:: https://raw.githubusercontent.com/OCA/reporting-engine/18.0/report_label/static/description/report_paperformat_label_form.png
72+
.. |conf_image_2| image:: https://raw.githubusercontent.com/OCA/reporting-engine/18.0/report_label/static/description/ir_actions_server.png
7373

7474
Usage
7575
=====
7676

77-
- In the target model's tree view, select the records to print.
77+
- In the target model's list view, select the records to print.
7878
- Click *Action* and your label report action name.
7979
- Select the number of labels per record to print, and click Print.
8080

8181
you can optionaly define an offset
8282

83-
|image|
83+
|usage_image_1|
8484

8585
The items will be printed in a pdf document.
8686

87-
|image1|
87+
|usage_image_2"|
8888

89-
.. |image| image:: https://raw.githubusercontent.com/OCA/reporting-engine/18.0/report_label/static/description/report_label_wizard_form.png
90-
.. |image1| image:: https://raw.githubusercontent.com/OCA/reporting-engine/18.0/report_label/static/description/report_result.png
89+
.. |usage_image_1| image:: https://raw.githubusercontent.com/OCA/reporting-engine/18.0/report_label/static/description/report_label_wizard_form.png
90+
.. |usage_image_2"| image:: https://raw.githubusercontent.com/OCA/reporting-engine/18.0/report_label/static/description/report_result.png
9191

9292
Known issues / Roadmap
9393
======================

report_label/__manifest__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
22
{
33
"name": "Report Labels",
4-
"version": "16.0.1.0.1",
4+
"version": "18.0.1.0.0",
55
"summary": "Print configurable self-adhesive labels reports",
66
"author": "Iván Todorovich, Moka Tourisme, Odoo Community Association (OCA)",
77
"website": "https://github.com/OCA/reporting-engine",

report_label/migrations/16.0.1.0.0/pre-migration.py

Lines changed: 0 additions & 40 deletions
This file was deleted.

report_label/models/ir_actions_server.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,10 @@ class IrActionsServer(models.Model):
1414
comodel_name="ir.ui.view",
1515
domain=[("type", "=", "qweb")],
1616
help="The QWeb template key to render the labels",
17-
states={"report_label": [("required", True)]},
1817
)
1918
label_paperformat_id = fields.Many2one(
2019
"report.paperformat.label",
2120
"Label Paper Format",
22-
states={"report_label": [("required", True)]},
2321
)
2422

2523
def _run_action_report_label_multi(self, eval_context=None):

report_label/readme/CONFIGURE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
You should reuse or create a Paperformat.
77

8-
![image](../static/description/report_paperformat_label_form.png)
8+
![conf_image_1](../static/description/report_paperformat_label_form.png)
99

1010
**Configure your Server action**
1111

@@ -19,7 +19,7 @@ Create your label report :
1919
- In the 'Label Qweb Template' create or reuse a QWeb template for your
2020
label.
2121

22-
![image](../static/description/ir_actions_server.png)
22+
![conf_image_2](../static/description/ir_actions_server.png)
2323

2424
**Importante Note**
2525

report_label/readme/USAGE.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
- In the target model's tree view, select the records to print.
1+
- In the target model's list view, select the records to print.
22
- Click *Action* and your label report action name.
33
- Select the number of labels per record to print, and click Print.
44

55
you can optionaly define an offset
66

7-
![image](../static/description/report_label_wizard_form.png)
7+
![usage_image_1](../static/description/report_label_wizard_form.png)
88

99
The items will be printed in a pdf document.
1010

11-
![image](../static/description/report_result.png)
11+
![usage_image_2"](../static/description/report_result.png)

report_label/static/description/index.html

Lines changed: 39 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@
88

99
/*
1010
:Author: David Goodger ([email protected])
11-
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
11+
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
1212
:Copyright: This stylesheet has been placed in the public domain.
1313
1414
Default cascading style sheet for the HTML output of Docutils.
15+
Despite the name, some widely supported CSS2 features are used.
1516
1617
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
1718
customize this style sheet.
@@ -274,7 +275,7 @@
274275
margin-left: 2em ;
275276
margin-right: 2em }
276277

277-
pre.code .ln { color: grey; } /* line numbers */
278+
pre.code .ln { color: gray; } /* line numbers */
278279
pre.code, code { background-color: #eeeeee }
279280
pre.code .comment, code .comment { color: #5C6576 }
280281
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
@@ -300,7 +301,7 @@
300301
span.pre {
301302
white-space: pre }
302303

303-
span.problematic {
304+
span.problematic, pre.problematic {
304305
color: red }
305306

306307
span.section-subtitle {
@@ -368,8 +369,9 @@ <h1 class="title">Report Labels</h1>
368369
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
369370
!! source digest: sha256:8d28b2e1c9d9a476ff84658100da7f8da9d5eb27cc86184e8e2979f476e863ca
370371
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
371-
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/reporting-engine/tree/16.0/report_label"><img alt="OCA/reporting-engine" src="https://img.shields.io/badge/github-OCA%2Freporting--engine-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/reporting-engine-16-0/reporting-engine-16-0-report_label"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/reporting-engine&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
372-
<p>This module allows you to create self-adhesive label printing actions on any model.</p>
372+
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/reporting-engine/tree/18.0/report_label"><img alt="OCA/reporting-engine" src="https://img.shields.io/badge/github-OCA%2Freporting--engine-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/reporting-engine-18-0/reporting-engine-18-0-report_label"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/reporting-engine&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
373+
<p>This module allows you to create self-adhesive label printing actions on
374+
any model.</p>
373375
<p><strong>Table of contents</strong></p>
374376
<div class="contents local topic" id="contents">
375377
<ul class="simple">
@@ -393,55 +395,61 @@ <h1><a class="toc-backref" href="#toc-entry-1">Configuration</a></h1>
393395
<li>Create your self-adhesive label paper formats.</li>
394396
</ul>
395397
<p>You should reuse or create a Paperformat.</p>
396-
<img alt="https://raw.githubusercontent.com/OCA/reporting-engine/16.0/report_label/static/description/report_paperformat_label_form.png" src="https://raw.githubusercontent.com/OCA/reporting-engine/16.0/report_label/static/description/report_paperformat_label_form.png" />
398+
<p><img alt="conf_image_1" src="https://raw.githubusercontent.com/OCA/reporting-engine/18.0/report_label/static/description/report_paperformat_label_form.png" /></p>
397399
<p><strong>Configure your Server action</strong></p>
398400
<ul class="simple">
399401
<li>Go to “Settings &gt; Technical &gt; Actions &gt; Server Actions”</li>
400402
</ul>
401403
<p>Create your label report :</p>
402404
<ul class="simple">
403405
<li>In the ‘Action to do’ field, select ‘Print Self-adhesive Labels’</li>
404-
<li>In the ‘Label Paper Format’ field, select your label paper format previously created</li>
405-
<li>In the ‘Label Qweb Template’ create or reuse a QWeb template for your label.</li>
406+
<li>In the ‘Label Paper Format’ field, select your label paper format
407+
previously created</li>
408+
<li>In the ‘Label Qweb Template’ create or reuse a QWeb template for your
409+
label.</li>
406410
</ul>
407-
<img alt="https://raw.githubusercontent.com/OCA/reporting-engine/16.0/report_label/static/description/ir_actions_server.png" src="https://raw.githubusercontent.com/OCA/reporting-engine/16.0/report_label/static/description/ir_actions_server.png" />
411+
<p><img alt="conf_image_2" src="https://raw.githubusercontent.com/OCA/reporting-engine/18.0/report_label/static/description/ir_actions_server.png" /></p>
408412
<p><strong>Importante Note</strong></p>
409-
<p><a class="reference external" href="https://github.com/OCA/reporting-engine/blob/14.0/report_label/reports/report_label.xml#L34">By design</a>, the variable used in this QWeb template must be named <cite>record</cite>.</p>
413+
<p><a class="reference external" href="https://github.com/OCA/reporting-engine/blob/14.0/report_label/reports/report_label.xml#L34">By
414+
design</a>,
415+
the variable used in this QWeb template must be named record.</p>
410416
</div>
411417
<div class="section" id="usage">
412418
<h1><a class="toc-backref" href="#toc-entry-2">Usage</a></h1>
413419
<ul class="simple">
414-
<li>In the target model’s tree view, select the records to print.</li>
420+
<li>In the target model’s list view, select the records to print.</li>
415421
<li>Click <em>Action</em> and your label report action name.</li>
416422
<li>Select the number of labels per record to print, and click Print.</li>
417423
</ul>
418424
<p>you can optionaly define an offset</p>
419-
<img alt="https://raw.githubusercontent.com/OCA/reporting-engine/16.0/report_label/static/description/report_label_wizard_form.png" src="https://raw.githubusercontent.com/OCA/reporting-engine/16.0/report_label/static/description/report_label_wizard_form.png" />
425+
<p><img alt="usage_image_1" src="https://raw.githubusercontent.com/OCA/reporting-engine/18.0/report_label/static/description/report_label_wizard_form.png" /></p>
420426
<p>The items will be printed in a pdf document.</p>
421-
<img alt="https://raw.githubusercontent.com/OCA/reporting-engine/16.0/report_label/static/description/report_result.png" src="https://raw.githubusercontent.com/OCA/reporting-engine/16.0/report_label/static/description/report_result.png" />
427+
<p><img alt="usage_image_2&quot;" src="https://raw.githubusercontent.com/OCA/reporting-engine/18.0/report_label/static/description/report_result.png" /></p>
422428
</div>
423429
<div class="section" id="known-issues-roadmap">
424430
<h1><a class="toc-backref" href="#toc-entry-3">Known issues / Roadmap</a></h1>
425431
<p>Known issues:</p>
426-
<ul class="simple">
427-
<li>This module depends on <cite>base_automation</cite> only because this module extends
428-
<cite>ir.actions.server</cite> with a new kind of action, and <cite>base.automation</cite> inherits
429-
from <cite>ir.actions.server</cite> by delegation in such a way that the modules cannot
430-
be loaded in another order.
431-
To do when migrating in version &gt; 16 :
432-
1. remove <tt class="docutils literal">base_automation</tt> dependency
433-
2. install <tt class="docutils literal">report_label</tt>
434-
3. install then <tt class="docutils literal">base_automation</tt>.
435-
If the installation of <tt class="docutils literal">base_automation</tt> works, the dependency can be
436-
replaced by <tt class="docutils literal">base</tt>.</li>
432+
<ul>
433+
<li><p class="first">This module depends on base_automation only because this module
434+
extends ir.actions.server with a new kind of action, and
435+
base.automation inherits from ir.actions.server by delegation in such
436+
a way that the modules cannot be loaded in another order. To do when
437+
migrating in version &gt; 16 :</p>
438+
<ol class="arabic simple">
439+
<li>remove <tt class="docutils literal">base_automation</tt> dependency</li>
440+
<li>install <tt class="docutils literal">report_label</tt></li>
441+
</ol>
442+
<p>3. install then <tt class="docutils literal">base_automation</tt>. If the installation of
443+
<tt class="docutils literal">base_automation</tt> works, the dependency can be replaced by <tt class="docutils literal">base</tt>.</p>
444+
</li>
437445
</ul>
438446
</div>
439447
<div class="section" id="bug-tracker">
440448
<h1><a class="toc-backref" href="#toc-entry-4">Bug Tracker</a></h1>
441449
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/reporting-engine/issues">GitHub Issues</a>.
442450
In case of trouble, please check there if your issue has already been reported.
443451
If you spotted it first, help us to smash it by providing a detailed and welcomed
444-
<a class="reference external" href="https://github.com/OCA/reporting-engine/issues/new?body=module:%20report_label%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
452+
<a class="reference external" href="https://github.com/OCA/reporting-engine/issues/new?body=module:%20report_label%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
445453
<p>Do not contact contributors directly about support or help with technical issues.</p>
446454
</div>
447455
<div class="section" id="credits">
@@ -465,7 +473,8 @@ <h2><a class="toc-backref" href="#toc-entry-7">Contributors</a></h2>
465473
</ul>
466474
</blockquote>
467475
</li>
468-
<li><p class="first">Sylvain LE GAL &lt;<a class="reference external" href="https://twitter.com/legalsylvain">https://twitter.com/legalsylvain</a>&gt;</p>
476+
<li><p class="first">Sylvain LE GAL
477+
&lt;<a class="reference external" href="https://twitter.com/legalsylvain&gt;">https://twitter.com/legalsylvain\&gt;</a></p>
469478
</li>
470479
<li><p class="first">Stefan Rijnhart &lt;<a class="reference external" href="mailto:stefan&#64;opener.amsterdam">stefan&#64;opener.amsterdam</a>&gt;</p>
471480
</li>
@@ -474,13 +483,15 @@ <h2><a class="toc-backref" href="#toc-entry-7">Contributors</a></h2>
474483
<div class="section" id="maintainers">
475484
<h2><a class="toc-backref" href="#toc-entry-8">Maintainers</a></h2>
476485
<p>This module is maintained by the OCA.</p>
477-
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
486+
<a class="reference external image-reference" href="https://odoo-community.org">
487+
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
488+
</a>
478489
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
479490
mission is to support the collaborative development of Odoo features and
480491
promote its widespread use.</p>
481492
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p>
482493
<p><a class="reference external image-reference" href="https://github.com/ivantodorovich"><img alt="ivantodorovich" src="https://github.com/ivantodorovich.png?size=40px" /></a></p>
483-
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/reporting-engine/tree/16.0/report_label">OCA/reporting-engine</a> project on GitHub.</p>
494+
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/reporting-engine/tree/18.0/report_label">OCA/reporting-engine</a> project on GitHub.</p>
484495
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
485496
</div>
486497
</div>

report_label/views/ir_actions_server.xml

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,20 @@
44
<field name="model">ir.actions.server</field>
55
<field name="inherit_id" ref="base.view_server_action_form" />
66
<field name="arch" type="xml">
7-
<field name="type" position="after">
8-
<field
9-
name="label_paperformat_id"
10-
attrs="{'invisible': [('state', '!=', 'report_label')]}"
11-
/>
12-
<field
13-
name="label_template_view_id"
14-
attrs="{'invisible': [('state', '!=', 'report_label')]}"
15-
/>
16-
</field>
7+
<xpath expr="//div[field[@name='state']]" position="after">
8+
<group>
9+
<field
10+
name="label_paperformat_id"
11+
invisible="state != 'report_label'"
12+
required="state == 'report_label'"
13+
/>
14+
<field
15+
name="label_template_view_id"
16+
invisible="state != 'report_label'"
17+
required="state == 'report_label'"
18+
/>
19+
</group>
20+
</xpath>
1721
</field>
1822
</record>
1923
</odoo>

report_label/views/report_paperformat_label.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,22 +37,22 @@
3737
</field>
3838
</record>
3939

40-
<record id="paperformat_label_view_tree" model="ir.ui.view">
40+
<record id="paperformat_label_view_list" model="ir.ui.view">
4141
<field name="model">report.paperformat.label</field>
4242
<field name="arch" type="xml">
43-
<tree>
43+
<list>
4444
<field name="name" />
4545
<field name="paperformat_id" />
4646
<field name="label_height" />
4747
<field name="label_width" />
48-
</tree>
48+
</list>
4949
</field>
5050
</record>
5151

5252
<record id="paperformat_label_action" model="ir.actions.act_window">
5353
<field name="name">Label paper format configuration</field>
5454
<field name="res_model">report.paperformat.label</field>
55-
<field name="view_mode">tree,form</field>
55+
<field name="view_mode">list,form</field>
5656
<field name="domain">[]</field>
5757
<field name="context">{}</field>
5858
</record>

0 commit comments

Comments
 (0)