Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[14.0][ADD] lrm_product_custom: add new module #2

Merged
merged 1 commit into from
Feb 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions lrm_product_custom/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
==================
Lrm Product Custom
==================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:2b895a8364649640178dc7927ae512e65320159d8522879718c60bd093a84c55
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-Escodoo%2Flrm--addons-lightgray.png?logo=github
:target: https://github.com/Escodoo/lrm-addons/tree/14.0/lrm_product_custom
:alt: Escodoo/lrm-addons

|badge1| |badge2| |badge3|

This module create a new product label report.

**Table of contents**

.. contents::
:local:

Usage
=====

To use this module, you need to:
- Open the `product.template` or `product.product` tree or form view.
- Click on the "Print" button.
- Select the new "Product Label" report and export to PDF.
- The PDF will have the dimensions 30mm X 60mm.
- Fill in the "Internal Reference" and "Barcode" fields to see them in the report.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/Escodoo/lrm-addons/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/Escodoo/lrm-addons/issues/new?body=module:%20lrm_product_custom%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.

Credits
=======

Authors
~~~~~~~

* Escodoo

Contributors
~~~~~~~~~~~~

* `Escodoo <https://escodoo.com.br>`_:

* Marcel Savegnago <[email protected]>
* Wesley Oliveira <[email protected]>

Maintainers
~~~~~~~~~~~

This module is part of the `Escodoo/lrm-addons <https://github.com/Escodoo/lrm-addons/tree/14.0/lrm_product_custom>`_ project on GitHub.

You are welcome to contribute.
Empty file added lrm_product_custom/__init__.py
Empty file.
17 changes: 17 additions & 0 deletions lrm_product_custom/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright 2024 - TODAY, Escodoo
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

{
"name": "Lrm Product Custom",
"summary": """
LRM Product Custom""",
"version": "14.0.1.0.0",
"license": "AGPL-3",
"author": "Escodoo",
"website": "https://github.com/Escodoo/lrm-addons",
"depends": ["product"],
"data": [
"report/product_reports.xml",
"report/product_templates.xml",
],
}
43 changes: 43 additions & 0 deletions lrm_product_custom/i18n/lrm_product_custom.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * lrm_product_custom
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-01-08 16:24+0000\n"
"PO-Revision-Date: 2025-01-08 16:24+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: lrm_product_custom
#: model:ir.actions.report,print_report_name:lrm_product_custom.action_report_product_product_label
#: model:ir.actions.report,print_report_name:lrm_product_custom.action_report_product_template_label
msgid "'Products Labels - %s' % (object.name)"
msgstr ""

#. module: lrm_product_custom
#: model_terms:ir.ui.view,arch_db:lrm_product_custom.report_product_label_custom
msgid "No barcode available"
msgstr ""

#. module: lrm_product_custom
#: model_terms:ir.ui.view,arch_db:lrm_product_custom.report_product_label_custom
msgid "No internal reference available"
msgstr ""

#. module: lrm_product_custom
#: model_terms:ir.ui.view,arch_db:lrm_product_custom.report_product_label_custom
msgid "Barcode"
msgstr ""

#. module: lrm_product_custom
#: model:ir.actions.report,name:lrm_product_custom.action_report_product_product_label
#: model:ir.actions.report,name:lrm_product_custom.action_report_product_template_label
msgid "Product Label"
msgstr ""
46 changes: 46 additions & 0 deletions lrm_product_custom/i18n/pt_BR.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * lrm_product_custom
#
# Translators:
# Wesley Oliveira <[email protected]>, 2025
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-01-08 10:24+0000\n"
"PO-Revision-Date: 2025-01-08 10:24+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: lrm_product_custom
#: model:ir.actions.report,print_report_name:lrm_product_custom.action_report_product_product_label
#: model:ir.actions.report,print_report_name:lrm_product_custom.action_report_product_template_label
msgid "'Products Labels - %s' % (object.name)"
msgstr "Etiquetas de Produto - %s' % (object.name)"

#. module: lrm_product_custom
#: model_terms:ir.ui.view,arch_db:lrm_product_custom.report_product_label_custom
msgid "No barcode available"
msgstr "Nenhum código de barras disponivel"

#. module: lrm_product_custom
#: model_terms:ir.ui.view,arch_db:lrm_product_custom.report_product_label_custom
msgid "No internal reference available"
msgstr "Nenhuma referência interna disponivel"

#. module: lrm_product_custom
#: model_terms:ir.ui.view,arch_db:lrm_product_custom.report_product_label_custom
msgid "Barcode"
msgstr "Código de Barras"

#. module: lrm_product_custom
#: model:ir.actions.report,name:lrm_product_custom.action_report_product_product_label
#: model:ir.actions.report,name:lrm_product_custom.action_report_product_template_label
msgid "Product Label"
msgstr "Etiquetas de Produto"
4 changes: 4 additions & 0 deletions lrm_product_custom/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
* `Escodoo <https://escodoo.com.br>`_:

* Marcel Savegnago <[email protected]>
* Wesley Oliveira <[email protected]>
1 change: 1 addition & 0 deletions lrm_product_custom/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This module create a new product label report.
6 changes: 6 additions & 0 deletions lrm_product_custom/readme/USAGE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
To use this module, you need to:
- Open the `product.template` or `product.product` tree or form view.
- Click on the "Print" button.
- Select the new "Product Label" report and export to PDF.
- The PDF will have the dimensions 30mm X 60mm.
- Fill in the "Internal Reference" and "Barcode" fields to see them in the report.
54 changes: 54 additions & 0 deletions lrm_product_custom/report/product_reports.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2024 - TODAY, Wesley Oliveira <[email protected]>
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
<odoo>

<record id="product_label_report_paperformat" model="report.paperformat">
<field name="name">Product Label</field>
<field name="default" eval="True" />
<field name="format">custom</field>
<field name="page_height">30</field>
<field name="page_width">60</field>
<field name="orientation">Portrait</field>
<field name="margin_top">0</field>
<field name="margin_bottom">0</field>
<field name="margin_left">0</field>
<field name="margin_right">0</field>
<field name="header_line" eval="False" />
<field name="header_spacing">0</field>
<field name="dpi">110</field>
</record>

<record id="action_report_product_product_label" model="ir.actions.report">
<field name="name">Product Label</field>
<field name="model">product.product</field>
<field name="report_type">qweb-pdf</field>
<field
name="report_name"
>lrm_product_custom.report_product_product_label</field>
<field
name="report_file"
>lrm_product_custom.report_product_product_label</field>
<field name="print_report_name">'Products Labels - %s' % (object.name)</field>
<field name="binding_model_id" ref="product.model_product_product" />
<field name="binding_type">report</field>
<field name="paperformat_id" ref="product_label_report_paperformat" />
</record>

<record id="action_report_product_template_label" model="ir.actions.report">
<field name="name">Product Label</field>
<field name="model">product.template</field>
<field name="report_type">qweb-pdf</field>
<field
name="report_name"
>lrm_product_custom.report_product_template_label</field>
<field
name="report_file"
>lrm_product_custom.report_product_template_label</field>
<field name="print_report_name">'Products Labels - %s' % (object.name)</field>
<field name="binding_model_id" ref="product.model_product_template" />
<field name="binding_type">report</field>
<field name="paperformat_id" ref="product_label_report_paperformat" />
</record>

</odoo>
80 changes: 80 additions & 0 deletions lrm_product_custom/report/product_templates.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!-- Copyright 2024 - TODAY, Wesley Oliveira <[email protected]>
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
<odoo>

<template id="report_product_label_custom">
<div style="width: 100%; height: 7rem; padding-top: .75rem;">
<div style="border: 2px solid black;">
<div
class="table-active text-left"
style="height: 3.5rem; overflow: hidden; font-size: 16px; padding: .5rem;"
>
<div style="max-height: 3.5rem; overflow: hidden;">
<strong t-field="product.display_name" />
</div>
</div>
<div
class="text-center align-middle"
style="height: 100%; padding: .5rem;"
>
<t t-if="product.barcode">
<img
alt="Barcode"
t-if="len(product.barcode) == 13"
t-att-src="'/report/barcode/?type=%s&amp;value=%s&amp;width=%s&amp;height=%s' % ('EAN13', quote_plus(product.barcode or ''), 600, 150)"
style="width:100%;height:2.5rem;"
/>
<img
alt="Barcode"
t-elif="len(product.barcode) == 8"
t-att-src="'/report/barcode/?type=%s&amp;value=%s&amp;width=%s&amp;height=%s' % ('EAN8', quote_plus(product.barcode or ''), 600, 150)"
style="width:100%;height:2.5rem;"
/>
<img
alt="Barcode"
t-else=""
t-att-src="'/report/barcode/?type=%s&amp;value=%s&amp;width=%s&amp;height=%s' % ('Code128', quote_plus(product.barcode or ''), 600, 150)"
style="width:100%;height:2.5rem"
/>
</t>
<t t-else=""><div class="text-muted">No barcode available</div></t>

<t t-if="product.default_code">
<span t-field="product.default_code" />
</t>
<t t-else=""><div
class="text-muted"
>No internal reference available</div></t>
</div>
</div>
</div>
</template>

<template id="report_product_product_label">
<t t-call="web.basic_layout">
<div class="page">
<t t-foreach="docs" t-as="product">
<t t-call="lrm_product_custom.report_product_label_custom">
<t t-set="product" t-value="product" />
</t>
</t>
</div>
</t>
</template>

<template id="report_product_template_label">
<t t-call="web.basic_layout">
<div class="page">
<t t-foreach="docs" t-as="template">
<t t-foreach="template.product_variant_ids" t-as="product">
<t t-call="lrm_product_custom.report_product_label_custom">
<t t-set="product" t-value="product" />
</t>
</t>
</t>
</div>
</t>
</template>

</odoo>
Binary file added lrm_product_custom/static/description/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading