[MIG] report_label: Migration to 14.0
parent
895139427b
commit
74991c2f6f
|
@ -14,13 +14,13 @@ Report Labels
|
|||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
|
||||
:alt: License: AGPL-3
|
||||
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Freporting--engine-lightgray.png?logo=github
|
||||
:target: https://github.com/OCA/reporting-engine/tree/12.0/report_label
|
||||
:target: https://github.com/OCA/reporting-engine/tree/14.0/report_label
|
||||
:alt: OCA/reporting-engine
|
||||
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
|
||||
:target: https://translation.odoo-community.org/projects/reporting-engine-12-0/reporting-engine-12-0-report_label
|
||||
:target: https://translation.odoo-community.org/projects/reporting-engine-14-0/reporting-engine-14-0-report_label
|
||||
:alt: Translate me on Weblate
|
||||
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
|
||||
:target: https://runbot.odoo-community.org/runbot/143/12.0
|
||||
:target: https://runbot.odoo-community.org/runbot/143/14.0
|
||||
:alt: Try me on Runbot
|
||||
|
||||
|badge1| |badge2| |badge3| |badge4| |badge5|
|
||||
|
@ -38,13 +38,13 @@ Configuration
|
|||
Go to **Settings > Technical > Analysis > Label Paper Format** and create
|
||||
your self-adhesive label paper formats.
|
||||
|
||||
.. image:: https://raw.githubusercontent.com/OCA/reporting-engine/12.0/report_label/static/description/configure_paperformat.png
|
||||
.. image:: https://raw.githubusercontent.com/OCA/reporting-engine/14.0/report_label/static/description/configure_paperformat.png
|
||||
|
||||
Go to **Settings > Technical > Analysis > Label Report** and create your label
|
||||
report, and its context action. You'll also need to create or reuse a
|
||||
QWeb template for you label.
|
||||
|
||||
.. image:: https://raw.githubusercontent.com/OCA/reporting-engine/12.0/report_label/static/description/configure_report_label.png
|
||||
.. image:: https://raw.githubusercontent.com/OCA/reporting-engine/14.0/report_label/static/description/configure_report_label.png
|
||||
|
||||
Usage
|
||||
=====
|
||||
|
@ -53,13 +53,13 @@ Usage
|
|||
2. Click *Action* and your label report action name.
|
||||
3. Select the number of labels per record to print, and click Print.
|
||||
|
||||
.. image:: https://raw.githubusercontent.com/OCA/reporting-engine/12.0/report_label/static/description/label_wizard.png
|
||||
.. image:: https://raw.githubusercontent.com/OCA/reporting-engine/14.0/report_label/static/description/label_wizard.png
|
||||
|
||||
Known issues / Roadmap
|
||||
======================
|
||||
|
||||
* `wkhtmltopdf` doesn't always respect dpi, and mm measures don't match. For
|
||||
this matter, it's recommended to use this module along with
|
||||
* `wkhtmltopdf` doesn't always respect dpi, and mm measures don't match. For
|
||||
this matter, it's recommended to use this module along with
|
||||
`report_wkhtmltopdf_param` and enable `--disable-smart-shrinking`.
|
||||
|
||||
Bug Tracker
|
||||
|
@ -68,7 +68,7 @@ Bug Tracker
|
|||
Bugs are tracked on `GitHub Issues <https://github.com/OCA/reporting-engine/issues>`_.
|
||||
In case of trouble, please check there if your issue has already been reported.
|
||||
If you spotted it first, help us smashing it by providing a detailed and welcomed
|
||||
`feedback <https://github.com/OCA/reporting-engine/issues/new?body=module:%20report_label%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
|
||||
`feedback <https://github.com/OCA/reporting-engine/issues/new?body=module:%20report_label%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
|
||||
|
||||
Do not contact contributors directly about support or help with technical issues.
|
||||
|
||||
|
@ -85,11 +85,12 @@ Contributors
|
|||
~~~~~~~~~~~~
|
||||
|
||||
* Iván Todorovich <ivan.todorovich@gmail.com>
|
||||
|
||||
* `Moka Tourisme <https://www.mokatourisme.fr>`_:
|
||||
|
||||
* Grégory Schreiner
|
||||
|
||||
* Sylvain LE GAL <https://twitter.com/legalsylvain>
|
||||
* Stefan Rijnhart <stefan@opener.amsterdam>
|
||||
|
||||
Maintainers
|
||||
~~~~~~~~~~~
|
||||
|
@ -112,6 +113,6 @@ Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
|
|||
|
||||
|maintainer-ivantodorovich|
|
||||
|
||||
This module is part of the `OCA/reporting-engine <https://github.com/OCA/reporting-engine/tree/12.0/report_label>`_ project on GitHub.
|
||||
This module is part of the `OCA/reporting-engine <https://github.com/OCA/reporting-engine/tree/14.0/report_label>`_ project on GitHub.
|
||||
|
||||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
{
|
||||
"name": "Report Labels",
|
||||
"version": "12.0.1.0.0",
|
||||
"version": "14.0.1.0.0",
|
||||
"summary": "Print configurable self-adhesive labels reports",
|
||||
"author": "Iván Todorovich, Moka Tourisme, Odoo Community Association (OCA)",
|
||||
"website": "https://github.com/OCA/reporting-engine",
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
from odoo import api, fields, models
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class IrActionsServer(models.Model):
|
||||
_inherit = "ir.actions.server"
|
||||
|
||||
state = fields.Selection(
|
||||
selection_add=[("report_label", "Print self-adhesive labels")]
|
||||
selection_add=[("report_label", "Print self-adhesive labels")],
|
||||
ondelete={"report_label": "cascade"},
|
||||
)
|
||||
label_template = fields.Char(
|
||||
"Label QWeb Template",
|
||||
|
@ -18,7 +20,6 @@ class IrActionsServer(models.Model):
|
|||
states={"report_label": [("required", True)]},
|
||||
)
|
||||
|
||||
@api.multi
|
||||
def report_label_associated_view(self):
|
||||
"""View the associated qweb templates"""
|
||||
self.ensure_one()
|
||||
|
@ -34,22 +35,21 @@ class IrActionsServer(models.Model):
|
|||
]
|
||||
return res
|
||||
|
||||
@api.model
|
||||
def run_action_report_label_multi(self, action, eval_context=None):
|
||||
def _run_action_report_label_multi(self, eval_context=None):
|
||||
"""Show report label wizard"""
|
||||
context = dict(self.env.context)
|
||||
context.update(
|
||||
{
|
||||
"label_template": action.label_template,
|
||||
"label_paperformat_id": action.label_paperformat_id.id,
|
||||
"res_model_id": action.model_id.id,
|
||||
"label_template": self.label_template,
|
||||
"label_paperformat_id": self.label_paperformat_id.id,
|
||||
"res_model_id": self.model_id.id,
|
||||
}
|
||||
)
|
||||
return {
|
||||
"name": action.name,
|
||||
"name": self.name,
|
||||
"type": "ir.actions.act_window",
|
||||
"res_model": "report.label.wizard",
|
||||
"context": str(context),
|
||||
"context": context,
|
||||
"view_mode": "form",
|
||||
"target": "new",
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
* Iván Todorovich <ivan.todorovich@gmail.com>
|
||||
|
||||
* `Moka Tourisme <https://www.mokatourisme.fr>`_:
|
||||
|
||||
* Grégory Schreiner
|
||||
|
||||
* Sylvain LE GAL <https://twitter.com/legalsylvain>
|
||||
* Stefan Rijnhart <stefan@opener.amsterdam>
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||
access_report_paperformat_label_all,report.paperformat.label all,model_report_paperformat_label,,1,,,
|
||||
access_report_paperformat_label_all,report.paperformat.label all,model_report_paperformat_label,base.group_user,1,0,0,0
|
||||
access_report_label_layout_admin,report.paperformat.label admin,model_report_paperformat_label,base.group_system,1,1,1,1
|
||||
access_report_label_wizard,report.label.wizard,model_report_label_wizard,base.group_user,1,1,1,1
|
||||
access_report_label_wizard_line,report.label.wizard.line,model_report_label_wizard_line,base.group_user,1,1,1,1
|
||||
|
|
|
|
@ -3,7 +3,7 @@
|
|||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" />
|
||||
<meta name="generator" content="Docutils: http://docutils.sourceforge.net/" />
|
||||
<title>Report Labels</title>
|
||||
<style type="text/css">
|
||||
|
||||
|
@ -367,7 +367,7 @@ ul.auto-toc {
|
|||
!! This file is generated by oca-gen-addon-readme !!
|
||||
!! changes will be overwritten. !!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
<p><a class="reference external" 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" 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" href="https://github.com/OCA/reporting-engine/tree/12.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" href="https://translation.odoo-community.org/projects/reporting-engine-12-0/reporting-engine-12-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" href="https://runbot.odoo-community.org/runbot/143/12.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
|
||||
<p><a class="reference external" 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" 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" href="https://github.com/OCA/reporting-engine/tree/14.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" href="https://translation.odoo-community.org/projects/reporting-engine-14-0/reporting-engine-14-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" href="https://runbot.odoo-community.org/runbot/143/14.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
|
||||
<p>This module allows you to create self-adhesive label printing actions on any model.</p>
|
||||
<p><strong>Table of contents</strong></p>
|
||||
<div class="contents local topic" id="contents">
|
||||
|
@ -388,11 +388,11 @@ ul.auto-toc {
|
|||
<h1><a class="toc-backref" href="#id1">Configuration</a></h1>
|
||||
<p>Go to <strong>Settings > Technical > Analysis > Label Paper Format</strong> and create
|
||||
your self-adhesive label paper formats.</p>
|
||||
<img alt="https://raw.githubusercontent.com/OCA/reporting-engine/12.0/report_label/static/description/configure_paperformat.png" src="https://raw.githubusercontent.com/OCA/reporting-engine/12.0/report_label/static/description/configure_paperformat.png" />
|
||||
<img alt="https://raw.githubusercontent.com/OCA/reporting-engine/14.0/report_label/static/description/configure_paperformat.png" src="https://raw.githubusercontent.com/OCA/reporting-engine/14.0/report_label/static/description/configure_paperformat.png" />
|
||||
<p>Go to <strong>Settings > Technical > Analysis > Label Report</strong> and create your label
|
||||
report, and its context action. You’ll also need to create or reuse a
|
||||
QWeb template for you label.</p>
|
||||
<img alt="https://raw.githubusercontent.com/OCA/reporting-engine/12.0/report_label/static/description/configure_report_label.png" src="https://raw.githubusercontent.com/OCA/reporting-engine/12.0/report_label/static/description/configure_report_label.png" />
|
||||
<img alt="https://raw.githubusercontent.com/OCA/reporting-engine/14.0/report_label/static/description/configure_report_label.png" src="https://raw.githubusercontent.com/OCA/reporting-engine/14.0/report_label/static/description/configure_report_label.png" />
|
||||
</div>
|
||||
<div class="section" id="usage">
|
||||
<h1><a class="toc-backref" href="#id2">Usage</a></h1>
|
||||
|
@ -401,7 +401,7 @@ QWeb template for you label.</p>
|
|||
<li>Click <em>Action</em> and your label report action name.</li>
|
||||
<li>Select the number of labels per record to print, and click Print.</li>
|
||||
</ol>
|
||||
<img alt="https://raw.githubusercontent.com/OCA/reporting-engine/12.0/report_label/static/description/label_wizard.png" src="https://raw.githubusercontent.com/OCA/reporting-engine/12.0/report_label/static/description/label_wizard.png" />
|
||||
<img alt="https://raw.githubusercontent.com/OCA/reporting-engine/14.0/report_label/static/description/label_wizard.png" src="https://raw.githubusercontent.com/OCA/reporting-engine/14.0/report_label/static/description/label_wizard.png" />
|
||||
</div>
|
||||
<div class="section" id="known-issues-roadmap">
|
||||
<h1><a class="toc-backref" href="#id3">Known issues / Roadmap</a></h1>
|
||||
|
@ -416,7 +416,7 @@ this matter, it’s recommended to use this module along with
|
|||
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/reporting-engine/issues">GitHub Issues</a>.
|
||||
In case of trouble, please check there if your issue has already been reported.
|
||||
If you spotted it first, help us smashing it by providing a detailed and welcomed
|
||||
<a class="reference external" href="https://github.com/OCA/reporting-engine/issues/new?body=module:%20report_label%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
|
||||
<a class="reference external" href="https://github.com/OCA/reporting-engine/issues/new?body=module:%20report_label%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
|
||||
<p>Do not contact contributors directly about support or help with technical issues.</p>
|
||||
</div>
|
||||
<div class="section" id="credits">
|
||||
|
@ -430,17 +430,20 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
|
|||
</div>
|
||||
<div class="section" id="contributors">
|
||||
<h2><a class="toc-backref" href="#id7">Contributors</a></h2>
|
||||
<ul>
|
||||
<li><p class="first">Iván Todorovich <<a class="reference external" href="mailto:ivan.todorovich@gmail.com">ivan.todorovich@gmail.com</a>></p>
|
||||
</li>
|
||||
<li><p class="first"><a class="reference external" href="https://www.mokatourisme.fr">Moka Tourisme</a>:</p>
|
||||
<blockquote>
|
||||
<ul class="simple">
|
||||
<li>Iván Todorovich <<a class="reference external" href="mailto:ivan.todorovich@gmail.com">ivan.todorovich@gmail.com</a>></li>
|
||||
<li><dl class="first docutils">
|
||||
<dt><a class="reference external" href="https://www.mokatourisme.fr">Moka Tourisme</a>:</dt>
|
||||
<dd><ul class="first last">
|
||||
<li>Grégory Schreiner</li>
|
||||
</ul>
|
||||
</dd>
|
||||
</dl>
|
||||
</blockquote>
|
||||
</li>
|
||||
<li><p class="first">Sylvain LE GAL <<a class="reference external" href="https://twitter.com/legalsylvain">https://twitter.com/legalsylvain</a>></p>
|
||||
</li>
|
||||
<li><p class="first">Stefan Rijnhart <<a class="reference external" href="mailto:stefan@opener.amsterdam">stefan@opener.amsterdam</a>></p>
|
||||
</li>
|
||||
<li>Sylvain LE GAL <<a class="reference external" href="https://twitter.com/legalsylvain">https://twitter.com/legalsylvain</a>></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="maintainers">
|
||||
|
@ -452,7 +455,7 @@ mission is to support the collaborative development of Odoo features and
|
|||
promote its widespread use.</p>
|
||||
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p>
|
||||
<p><a class="reference external" href="https://github.com/ivantodorovich"><img alt="ivantodorovich" src="https://github.com/ivantodorovich.png?size=40px" /></a></p>
|
||||
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/reporting-engine/tree/12.0/report_label">OCA/reporting-engine</a> project on GitHub.</p>
|
||||
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/reporting-engine/tree/14.0/report_label">OCA/reporting-engine</a> project on GitHub.</p>
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from ast import literal_eval
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo.tests import common
|
||||
|
||||
|
@ -14,9 +14,14 @@ class TestReportLabel(common.TransactionCase):
|
|||
self.partner_label.create_action()
|
||||
action = self.partner_label.run()
|
||||
model = action["res_model"]
|
||||
context = literal_eval(action["context"])
|
||||
context["active_model"] = "res.partner"
|
||||
context["active_ids"] = self.env["res.partner"].search([]).ids
|
||||
context = action["context"]
|
||||
context.update(
|
||||
{
|
||||
"active_model": "res.partner",
|
||||
"active_ids": self.env["res.partner"].search([]).ids,
|
||||
"discard_logo_check": True,
|
||||
}
|
||||
)
|
||||
wizard = self.env[model].with_context(context).create({})
|
||||
report_action = wizard.print_report()
|
||||
self.assertEquals(report_action["type"], "ir.actions.report")
|
||||
|
|
|
@ -30,7 +30,6 @@
|
|||
<record id="report_label_action" model="ir.actions.act_window">
|
||||
<field name="name">Label Reports</field>
|
||||
<field name="res_model">ir.actions.server</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[("state", "=", "report_label")]</field>
|
||||
<field name="context">{"default_state": "report_label"}</field>
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
<attribute name="invisible">1</attribute>
|
||||
</field>
|
||||
<!-- Add label paper format fields -->
|
||||
<form position="inside">
|
||||
<sheet position="inside">
|
||||
<group name="label">
|
||||
<group name="label_size" string="Label Size" colspan="2">
|
||||
<field name="label_height" />
|
||||
|
@ -36,7 +36,7 @@
|
|||
<field string="Left (mm)" name="label_margin_left" />
|
||||
</group>
|
||||
</group>
|
||||
</form>
|
||||
</sheet>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
@ -54,7 +54,6 @@
|
|||
<record id="paperformat_label_action" model="ir.actions.act_window">
|
||||
<field name="name">Label paper format configuration</field>
|
||||
<field name="res_model">report.paperformat.label</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[]</field>
|
||||
<field name="context">{}</field>
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
from odoo import api, fields, models
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue