diff --git a/product_print_category/README.rst b/product_print_category/README.rst new file mode 100644 index 00000000000..eda1e0c350b --- /dev/null +++ b/product_print_category/README.rst @@ -0,0 +1,158 @@ +========================== +Product - Print Categories +========================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:8d48aa7ef074d7b26a9298755ed6ba26c867a42cd95766b91a22de0e07f241ec + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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-OCA%2Fproduct--attribute-lightgray.png?logo=github + :target: https://github.com/OCA/product-attribute/tree/17.0/product_print_category + :alt: OCA/product-attribute +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/product-attribute-17-0/product-attribute-17-0-product_print_category + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/builds?repo=OCA/product-attribute&target_branch=17.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module is designed to extend product printing features. It allows +user to create new print categories of products depending of the data +that are on the labels of the products variants. + +When a field has changed, the product will be set as 'To print' +automatically. + +This module requires to install custom modules to have pricetags +templates, or alternatively to create pricetag reports templates by UI. + +**Table of contents** + +.. contents:: + :local: + +Configuration +============= + +**Group setting** + +- Add yourself to the 'Print Category Manager' group in the 'Pricetags' + category. + +**Create Print Categories** + +- Go to 'Sales' > 'Products' > 'Print Categories' + +- Find or create new print categories of products + + - Set the fields that will trigger to print again the product label + (e.g : name, sale price etc.) + - Set the qweb view that will be used for this category + +|image1| + +Alternatively, you can create product print categories and qweb in a +custom module. + +**Affect products to the categories** + +- Go to "Sales" > "Products" > "Product variants" (or "Products" if + variants are not activated). +- Go to your product in General Information tab +- Set a print category + +|image2| + +**Create Print Category Rules** + +- Go to 'Sales' > 'Products' > 'Print Category Rules' + +Create various ordered rules depending on product category and company. + +This system allow to automatically set / remove print category to a +product, when changing its company or its category. + +|image3| + +.. |image1| image:: https://raw.githubusercontent.com/OCA/product-attribute/17.0/product_print_category/static/description/product_print_category_form.png +.. |image2| image:: https://raw.githubusercontent.com/OCA/product-attribute/17.0/product_print_category/static/description/product_product_form.png +.. |image3| image:: https://raw.githubusercontent.com/OCA/product-attribute/17.0/product_print_category/static/description/product_print_category_rule_tree.png + +Usage +===== + +- Go to "Sales" > "Products" > "Print Categories" +- Choose between "Print Obsolete Products" or "Print All Products" + +|image4| + +- Alternatively you can select product in product or variants list view + and click on "Action" > "Print Products" + +.. |image4| image:: https://raw.githubusercontent.com/OCA/product-attribute/17.0/product_print_category/static/description/product_print_wizard_form.png + +Bug Tracker +=========== + +Bugs are tracked on `GitHub 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 `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* GRAP +* La Louve +* Coop IT Easy SC + +Contributors +------------ + +- Sylvain LE GAL +- Quentin DUPONT +- `Binhex `__: + + - Mario Luis + +Maintainers +----------- + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +.. |maintainer-legalsylvain| image:: https://github.com/legalsylvain.png?size=40px + :target: https://github.com/legalsylvain + :alt: legalsylvain + +Current `maintainer `__: + +|maintainer-legalsylvain| + +This module is part of the `OCA/product-attribute `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/product_print_category/__init__.py b/product_print_category/__init__.py new file mode 100644 index 00000000000..50235cbb122 --- /dev/null +++ b/product_print_category/__init__.py @@ -0,0 +1,3 @@ +from . import models +from . import wizard +from . import report diff --git a/product_print_category/__manifest__.py b/product_print_category/__manifest__.py new file mode 100644 index 00000000000..0427b94349a --- /dev/null +++ b/product_print_category/__manifest__.py @@ -0,0 +1,46 @@ +# Copyright (C) 2012-Today GRAP (http://www.grap.coop) +# Copyright (C) 2016-Today: La Louve () +# Copyright (C) 2021-Today: Coop IT Easy () +# @author: Sylvain LE GAL (https://twitter.com/legalsylvain) +# @author: Rémy TAYMANS () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +{ + "name": "Product - Print Categories", + "summary": "Define print categories for products" + " and automate products print, when data has changed", + "version": "17.0.1.0.0", + "category": "Product", + "license": "AGPL-3", + "website": "https://github.com/OCA/product-attribute", + "maintainers": ["legalsylvain"], + "author": "GRAP, " + "La Louve, " + "Coop IT Easy SC, " + "Odoo Community Association (OCA)", + "depends": [ + "sale_management", + "product", + ], + "demo": [ + "demo/res_groups.xml", + "demo/qweb_template.xml", + "demo/product_print_category.xml", + "demo/product_print_category_rule.xml", + "demo/product_product.xml", + ], + "data": [ + "security/res_groups.xml", + "security/ir_rule.xml", + "security/ir.model.access.csv", + "data/report_paperformat.xml", + "report/report_pricetag.xml", + "report/ir_actions_report.xml", + "wizard/view_product_print_wizard.xml", + "views/view_product_product.xml", + "views/view_product_template.xml", + "views/view_product_print_category.xml", + "views/view_product_print_category_rule.xml", + ], + "installable": True, +} diff --git a/product_print_category/data/report_paperformat.xml b/product_print_category/data/report_paperformat.xml new file mode 100644 index 00000000000..862a36b6c30 --- /dev/null +++ b/product_print_category/data/report_paperformat.xml @@ -0,0 +1,22 @@ + + + + + + Products Print Format + A4 + 96 + Portrait + 5 + 5 + 5 + 5 + 0 + + + + diff --git a/product_print_category/demo/product_print_category.xml b/product_print_category/demo/product_print_category.xml new file mode 100644 index 00000000000..5dec0472a39 --- /dev/null +++ b/product_print_category/demo/product_print_category.xml @@ -0,0 +1,34 @@ + + + + + + Demo Category 1 + + + + + + + + Demo Category 2 + + + + + + + diff --git a/product_print_category/demo/product_print_category_rule.xml b/product_print_category/demo/product_print_category_rule.xml new file mode 100644 index 00000000000..f9f2baa426d --- /dev/null +++ b/product_print_category/demo/product_print_category_rule.xml @@ -0,0 +1,31 @@ + + + + + + 1 + + + + + + + 2 + + + + + + + 100 + + + + + + + diff --git a/product_print_category/demo/product_product.xml b/product_print_category/demo/product_product.xml new file mode 100644 index 00000000000..78c44c1faf5 --- /dev/null +++ b/product_print_category/demo/product_product.xml @@ -0,0 +1,19 @@ + + + + + + Demo Product With Print category 1 + + + + + Demo Product With Print category 2 + + + + diff --git a/product_print_category/demo/qweb_template.xml b/product_print_category/demo/qweb_template.xml new file mode 100644 index 00000000000..f720fe0e7ff --- /dev/null +++ b/product_print_category/demo/qweb_template.xml @@ -0,0 +1,61 @@ + + + + + + + + + diff --git a/product_print_category/demo/res_groups.xml b/product_print_category/demo/res_groups.xml new file mode 100644 index 00000000000..1c96cb01e67 --- /dev/null +++ b/product_print_category/demo/res_groups.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/product_print_category/i18n/es.po b/product_print_category/i18n/es.po new file mode 100644 index 00000000000..453a3d79a39 --- /dev/null +++ b/product_print_category/i18n/es.po @@ -0,0 +1,336 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_print_category +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-11-15 20:38+0000\n" +"Last-Translator: Ivorra78 \n" +"Language-Team: none\n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.17\n" + +#. module: product_print_category +#: model:ir.actions.report,print_report_name:product_print_category.pricetag +msgid "'Products Labels'" +msgstr "'Etiquetas de Productos'" + +#. module: product_print_category +#: model_terms:ir.ui.view,arch_db:product_print_category.view_product_print_category_form_2 +msgid "Products" +msgstr "Productos" + +#. module: product_print_category +#: model_terms:ir.ui.view,arch_db:product_print_category.view_product_print_category_form_2 +msgid "To print" +msgstr "Para imprimir" + +#. module: product_print_category +#: model_terms:ir.ui.view,arch_db:product_print_category.qweb_template_demo_1 +#: model_terms:ir.ui.view,arch_db:product_print_category.qweb_template_demo_2 +msgid "Code:" +msgstr "Código:" + +#. module: product_print_category +#: model_terms:ir.ui.view,arch_db:product_print_category.qweb_template_demo_1 +#: model_terms:ir.ui.view,arch_db:product_print_category.qweb_template_demo_2 +msgid "Price:" +msgstr "Precio:" + +#. module: product_print_category +#: model:ir.model,name:product_print_category.model_product_print_category_mixin +msgid "Abstract Model for Product Print Categories" +msgstr "Modelo abstracto de categorías de impresión de productos" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category__active +msgid "Active" +msgstr "Activo" + +#. module: product_print_category +#: model_terms:ir.ui.view,arch_db:product_print_category.view_product_print_wizard_form +msgid "Cancel" +msgstr "Cancelar" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category__company_id +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category_rule__company_id +msgid "Company" +msgstr "Companía" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category__create_uid +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category_rule__create_uid +#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard__create_uid +#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard_line__create_uid +msgid "Created by" +msgstr "Creado por" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category__create_date +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category_rule__create_date +#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard__create_date +#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard_line__create_date +msgid "Created on" +msgstr "Creado el" + +#. module: product_print_category +#: model:product.print.category,name:product_print_category.demo_category_1 +msgid "Demo Category 1" +msgstr "Demo Categoría 1" + +#. module: product_print_category +#: model:product.print.category,name:product_print_category.demo_category_2 +msgid "Demo Category 2" +msgstr "Demo Categoría 2" + +#. module: product_print_category +#: model:product.template,name:product_print_category.demo_product_1_product_template +msgid "Demo Product With Print category 1" +msgstr "Producto de Demostración con Categoría de Impresión 1" + +#. module: product_print_category +#: model:product.template,name:product_print_category.demo_product_2_product_template +msgid "Demo Product With Print category 2" +msgstr "Producto de Demostración con Categoría de Impresión 2" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category__display_name +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category_rule__display_name +#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard__display_name +#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard_line__display_name +msgid "Display Name" +msgstr "Mostrar Nombre" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category__field_ids +msgid "Fields related to printing" +msgstr "Campos relacionados con la impresión" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category__id +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category_rule__id +#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard__id +#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard_line__id +msgid "ID" +msgstr "ID (identificación)" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category____last_update +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category_rule____last_update +#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard____last_update +#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard_line____last_update +msgid "Last Modified on" +msgstr "Última modificación el" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category__write_uid +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category_rule__write_uid +#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard__write_uid +#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard_line__write_uid +msgid "Last Updated by" +msgstr "Última Actualización por" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category__write_date +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category_rule__write_date +#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard__write_date +#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard_line__write_date +msgid "Last Updated on" +msgstr "Última Actualización el" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard__line_ids +msgid "Lines" +msgstr "Líneas" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category_rule__main_category_id +msgid "Main Category" +msgstr "Categoría Principal" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category__name +#: model_terms:ir.ui.view,arch_db:product_print_category.view_product_print_category_form_2 +msgid "Name" +msgstr "Nombre" + +#. module: product_print_category +#. odoo-python +#: code:addons/product_print_category/wizard/product_print_wizard.py:0 +#, python-format +msgid "" +"Please set a print category for the following lines \n" +"\n" +"- %s" +msgstr "" +"Por favor, establezca una categoría de impresión para las siguientes " +"líneas \n" +"\n" +"- %s" + +#. module: product_print_category +#: model:ir.model,name:product_print_category.model_report_product_print_category_report_pricetag +msgid "Pricetag report" +msgstr "Informe de precios" + +#. module: product_print_category +#: model:ir.actions.report,name:product_print_category.pricetag +msgid "Pricetags" +msgstr "Etiquetas de precios" + +#. module: product_print_category +#: model_terms:ir.ui.view,arch_db:product_print_category.view_product_print_wizard_form +msgid "Print" +msgstr "Imprimir" + +#. module: product_print_category +#: model_terms:ir.ui.view,arch_db:product_print_category.view_product_print_category_form_2 +msgid "Print All Products" +msgstr "Imprimir Todos los Productos" + +#. module: product_print_category +#: model:ir.actions.act_window,name:product_print_category.action_product_print_category +#: model:ir.ui.menu,name:product_print_category.menu_product_print_category +msgid "Print Categories" +msgstr "Imprimir Categorías" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category_rule__print_category_id +#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard_line__print_category_id +#: model:ir.model.fields,field_description:product_print_category.field_product_product__print_category_id +#: model:ir.model.fields,field_description:product_print_category.field_product_template__print_category_id +msgid "Print Category" +msgstr "Imprimir Categoría" + +#. module: product_print_category +#: model:res.groups,name:product_print_category.manager +msgid "Print Category Manager" +msgstr "Responsable de la Categoría de Impresión" + +#. module: product_print_category +#: model:ir.actions.act_window,name:product_print_category.action_product_print_category_rule +#: model:ir.ui.menu,name:product_print_category.menu_product_print_category_rule +msgid "Print Category Rules" +msgstr "Reglas de la Categoría de Impresión" + +#. module: product_print_category +#: model:ir.model,name:product_print_category.model_product_print_category_rule +msgid "Print Category Rules for Product" +msgstr "Imprimir Reglas de Categoría para Producto" + +#. module: product_print_category +#: model:ir.model,name:product_print_category.model_product_print_category +msgid "Print Category for Product" +msgstr "Imprimir Categoría de Producto" + +#. module: product_print_category +#: model_terms:ir.ui.view,arch_db:product_print_category.view_product_print_category_form_2 +msgid "Print Obsolete Products" +msgstr "Imprimir Productos Obsoletos" + +#. module: product_print_category +#: model:ir.actions.act_window,name:product_print_category.action_product_product_2_product_print_wizard +#: model:ir.actions.act_window,name:product_print_category.action_product_template_2_product_print_wizard +#: model_terms:ir.ui.view,arch_db:product_print_category.view_product_print_wizard_form +msgid "Print Products" +msgstr "Imprimir Productos" + +#. module: product_print_category +#: model_terms:ir.ui.view,arch_db:product_print_category.view_product_print_category_form_2 +msgid "Print category name" +msgstr "Imprimir nombre de categoría" + +#. module: product_print_category +#: model_terms:ir.ui.view,arch_db:product_print_category.view_product_template_only_form +msgid "Print options should be configured on Product Variants" +msgstr "Las opciones de impresión deben configurarse en Variantes de producto" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category_rule__sequence +msgid "Priority" +msgstr "Prioridad" + +#. module: product_print_category +#: model:ir.model,name:product_print_category.model_product_template +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category__product_ids +#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard_line__product_id +msgid "Product" +msgstr "Producto" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category__product_to_print_ids +msgid "Product To Print" +msgstr "Producto para Imprimir" + +#. module: product_print_category +#: model:ir.model,name:product_print_category.model_product_product +msgid "Product Variant" +msgstr "Variante de Producto" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category__product_qty +msgid "Products" +msgstr "Productos" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category__product_to_print_qty +msgid "Products To Print" +msgstr "Productos para Imprimir" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard_line__quantity +msgid "Quantity" +msgstr "Cantidad" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category__qweb_view_id +msgid "Qweb View" +msgstr "Vista de la QWeb" + +#. module: product_print_category +#: model:ir.model.fields,help:product_print_category.field_product_print_category_rule__company_id +msgid "Restrict the access of this rule to the given company" +msgstr "Restringir el acceso de esta regla a la empresa indicada" + +#. module: product_print_category +#: model:ir.model.fields,help:product_print_category.field_product_print_category_rule__main_category_id +msgid "" +"This rule will be applied only to products that belong to the given " +"category, or to its children." +msgstr "" +"Esta regla se aplicará sólo a los productos que pertenezcan a la categoría " +"dada, o a sus hijos." + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_product__to_print +#: model:ir.model.fields,field_description:product_print_category.field_product_template__to_print +msgid "To Print" +msgstr "Imprimir" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard_line__wizard_id +msgid "Wizard" +msgstr "Asistente" + +#. module: product_print_category +#: model:ir.model,name:product_print_category.model_product_print_wizard +msgid "Wizard for printing products" +msgstr "Asistente para la impresión de productos" + +#. module: product_print_category +#: model:ir.model,name:product_print_category.model_product_print_wizard_line +msgid "Wizard line for printing products" +msgstr "Asistente de línea para la impresión de productos" + +#. module: product_print_category +#: model_terms:ir.ui.view,arch_db:product_print_category.view_product_print_wizard_form +msgid "⚠️ If you change Print Category here, it will be changed in the product." +msgstr "" +"⚠️ Si cambia la Categoría de Impresión aquí, se cambiará en el producto." diff --git a/product_print_category/i18n/fr.po b/product_print_category/i18n/fr.po new file mode 100644 index 00000000000..3cc7e145942 --- /dev/null +++ b/product_print_category/i18n/fr.po @@ -0,0 +1,341 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_print_category +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2023-01-18 16:49+0000\n" +"PO-Revision-Date: 2023-01-18 16:49+0000\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: product_print_category +#: model:ir.actions.report,print_report_name:product_print_category.pricetag +msgid "'Products Labels'" +msgstr "'Etiquettes d\\'articles'" + +#. module: product_print_category +#: model_terms:ir.ui.view,arch_db:product_print_category.view_product_print_category_form_2 +msgid "Products" +msgstr "Articles" + +#. module: product_print_category +#: model_terms:ir.ui.view,arch_db:product_print_category.view_product_print_category_form_2 +msgid "To print" +msgstr "A imprimer" + +#. module: product_print_category +#: model_terms:ir.ui.view,arch_db:product_print_category.qweb_template_demo_1 +#: model_terms:ir.ui.view,arch_db:product_print_category.qweb_template_demo_2 +msgid "Code:" +msgstr "Code :" + +#. module: product_print_category +#: model_terms:ir.ui.view,arch_db:product_print_category.qweb_template_demo_1 +#: model_terms:ir.ui.view,arch_db:product_print_category.qweb_template_demo_2 +msgid "Price:" +msgstr "Prix :" + +#. module: product_print_category +#: model:ir.model,name:product_print_category.model_product_print_category_mixin +msgid "Abstract Model for Product Print Categories" +msgstr "Modèle abstrait pouir les catégories d'impression d'articles" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category__active +msgid "Active" +msgstr "Actif" + +#. module: product_print_category +#: model_terms:ir.ui.view,arch_db:product_print_category.view_product_print_wizard_form +msgid "Cancel" +msgstr "Annuler" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category__company_id +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category_rule__company_id +msgid "Company" +msgstr "Société" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category__create_uid +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category_rule__create_uid +#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard__create_uid +#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard_line__create_uid +msgid "Created by" +msgstr "Créé par" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category__create_date +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category_rule__create_date +#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard__create_date +#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard_line__create_date +msgid "Created on" +msgstr "Créé le" + +#. module: product_print_category +#: model:product.print.category,name:product_print_category.demo_category_1 +msgid "Demo Category 1" +msgstr "Catégorie 1" + +#. module: product_print_category +#: model:product.print.category,name:product_print_category.demo_category_2 +msgid "Demo Category 2" +msgstr "Catégorie 2" + +#. module: product_print_category +#: model:product.template,name:product_print_category.demo_product_1_product_template +msgid "Demo Product With Print category 1" +msgstr "Article de démo avec catégorie 1" + +#. module: product_print_category +#: model:product.template,name:product_print_category.demo_product_2_product_template +msgid "Demo Product With Print category 2" +msgstr "Article de démo avec catégorie 2" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category__display_name +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category_rule__display_name +#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard__display_name +#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard_line__display_name +msgid "Display Name" +msgstr "Nom affiché" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category__field_ids +msgid "Fields related to printing" +msgstr "Champs déclenchant l'impression" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category__id +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category_rule__id +#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard__id +#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard_line__id +msgid "ID" +msgstr "" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category____last_update +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category_rule____last_update +#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard____last_update +#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard_line____last_update +msgid "Last Modified on" +msgstr "Dernière modification le" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category__write_uid +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category_rule__write_uid +#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard__write_uid +#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard_line__write_uid +msgid "Last Updated by" +msgstr "Dernière mise à jour par" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category__write_date +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category_rule__write_date +#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard__write_date +#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard_line__write_date +msgid "Last Updated on" +msgstr "Dernière mise à jour le" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard__line_ids +msgid "Lines" +msgstr "Lignes" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category_rule__main_category_id +msgid "Main Category" +msgstr "Catégorie principale" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category__name +#: model_terms:ir.ui.view,arch_db:product_print_category.view_product_print_category_form_2 +msgid "Name" +msgstr "Nom" + +#. module: product_print_category +#. odoo-python +#: code:addons/product_print_category/wizard/product_print_wizard.py:0 +#, python-format +msgid "" +"Please set a print category for the following lines \n" +"\n" +"- %s" +msgstr "" +"Veuillez renseigner la catégorie d'impression pour les lignes suivantes \n" +"\n" +"- %s" + +#. module: product_print_category +#: model:ir.model,name:product_print_category.model_report_product_print_category_report_pricetag +msgid "Pricetag report" +msgstr "Rapport d'étiquette" + +#. module: product_print_category +#: model:ir.actions.report,name:product_print_category.pricetag +msgid "Pricetags" +msgstr "Etiquettes" + +#. module: product_print_category +#: model_terms:ir.ui.view,arch_db:product_print_category.view_product_print_wizard_form +msgid "Print" +msgstr "Imprimer" + +#. module: product_print_category +#: model_terms:ir.ui.view,arch_db:product_print_category.view_product_print_category_form_2 +msgid "Print All Products" +msgstr "Imprimer tous les articles" + +#. module: product_print_category +#: model:ir.actions.act_window,name:product_print_category.action_product_print_category +#: model:ir.ui.menu,name:product_print_category.menu_product_print_category +msgid "Print Categories" +msgstr "Catégories d'impression" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category_rule__print_category_id +#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard_line__print_category_id +#: model:ir.model.fields,field_description:product_print_category.field_product_product__print_category_id +#: model:ir.model.fields,field_description:product_print_category.field_product_template__print_category_id +msgid "Print Category" +msgstr "Catégorie d'impression" + +#. module: product_print_category +#: model:res.groups,name:product_print_category.manager +msgid "Print Category Manager" +msgstr "Responsable de catégorie d'impression" + +#. module: product_print_category +#: model:ir.actions.act_window,name:product_print_category.action_product_print_category_rule +#: model:ir.ui.menu,name:product_print_category.menu_product_print_category_rule +msgid "Print Category Rules" +msgstr "Règles de catégorie d'impression" + +#. module: product_print_category +#: model:ir.model,name:product_print_category.model_product_print_category_rule +msgid "Print Category Rules for Product" +msgstr "Règles de catégorie d'impression pour les produits" + +#. module: product_print_category +#: model:ir.model,name:product_print_category.model_product_print_category +msgid "Print Category for Product" +msgstr "Catégorie d'impression pour les articles" + +#. module: product_print_category +#: model_terms:ir.ui.view,arch_db:product_print_category.view_product_print_category_form_2 +msgid "Print Obsolete Products" +msgstr "Imprimer les articles obsolètes" + +#. module: product_print_category +#: model:ir.actions.act_window,name:product_print_category.action_product_product_2_product_print_wizard +#: model:ir.actions.act_window,name:product_print_category.action_product_template_2_product_print_wizard +#: model_terms:ir.ui.view,arch_db:product_print_category.view_product_print_wizard_form +msgid "Print Products" +msgstr "Imprimer les articles" + +#. module: product_print_category +#: model_terms:ir.ui.view,arch_db:product_print_category.view_product_print_category_form_2 +msgid "Print category name" +msgstr "Nom de la catégorie d'impression" + +#. module: product_print_category +#: model_terms:ir.ui.view,arch_db:product_print_category.view_product_template_only_form +msgid "Print options should be configured on Product Variants" +msgstr "" +"Les options d'impression doivent être configurées au niveau de la variante " +"d'article" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category_rule__sequence +msgid "Priority" +msgstr "Priorité" + +#. module: product_print_category +#: model:ir.model,name:product_print_category.model_product_template +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category__product_ids +#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard_line__product_id +msgid "Product" +msgstr "Produit" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category__product_to_print_ids +msgid "Product To Print" +msgstr "Article à réimprimer" + +#. module: product_print_category +#: model:ir.model,name:product_print_category.model_product_product +msgid "Product Variant" +msgstr "Variante de produit" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category__product_qty +msgid "Products" +msgstr "Articles" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category__product_to_print_qty +msgid "Products To Print" +msgstr "Articles à réimprimer" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard_line__quantity +msgid "Quantity" +msgstr "Quantité" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category__qweb_view_id +msgid "Qweb View" +msgstr "Vue Qweb" + +#. module: product_print_category +#: model:ir.model.fields,help:product_print_category.field_product_print_category_rule__company_id +msgid "Restrict the access of this rule to the given company" +msgstr "Restreindre l'accès à cette règle à la société définie." + +#. module: product_print_category +#: model:ir.model.fields,help:product_print_category.field_product_print_category_rule__main_category_id +msgid "" +"This rule will be applied only to products that belong to the given " +"category, or to its children." +msgstr "" +"Cette règle sera appliqué seulement aux articles qui appartiennent à la " +"catégorie définie, ou aux catégories enfants." + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_product__to_print +#: model:ir.model.fields,field_description:product_print_category.field_product_template__to_print +msgid "To Print" +msgstr "À imprimer" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard_line__wizard_id +msgid "Wizard" +msgstr "Assistant" + +#. module: product_print_category +#: model:ir.model,name:product_print_category.model_product_print_wizard +msgid "Wizard for printing products" +msgstr "assistant pour l'impression d'articles" + +#. module: product_print_category +#: model:ir.model,name:product_print_category.model_product_print_wizard_line +msgid "Wizard line for printing products" +msgstr "Ligne d'assistant pour l'impression d'articles" + +#. module: product_print_category +#: model_terms:ir.ui.view,arch_db:product_print_category.view_product_print_wizard_form +msgid "⚠️ If you change Print Category here, it will be changed in the product." +msgstr "" +"⚠️ Si vous changez une catégorie d'impression ici, elle sera changée dans la " +"fiche article." + +#~ msgid "Print Category User" +#~ msgstr "Utilisateur·rice de catégorie d'impression" diff --git a/product_print_category/i18n/it.po b/product_print_category/i18n/it.po new file mode 100644 index 00000000000..dc888c2c7a5 --- /dev/null +++ b/product_print_category/i18n/it.po @@ -0,0 +1,334 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_print_category +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-11-07 09:39+0000\n" +"Last-Translator: mymage \n" +"Language-Team: none\n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.17\n" + +#. module: product_print_category +#: model:ir.actions.report,print_report_name:product_print_category.pricetag +msgid "'Products Labels'" +msgstr "'Etichette prodotti'" + +#. module: product_print_category +#: model_terms:ir.ui.view,arch_db:product_print_category.view_product_print_category_form_2 +msgid "Products" +msgstr "Prodotti" + +#. module: product_print_category +#: model_terms:ir.ui.view,arch_db:product_print_category.view_product_print_category_form_2 +msgid "To print" +msgstr "Da stampare" + +#. module: product_print_category +#: model_terms:ir.ui.view,arch_db:product_print_category.qweb_template_demo_1 +#: model_terms:ir.ui.view,arch_db:product_print_category.qweb_template_demo_2 +msgid "Code:" +msgstr "Codice:" + +#. module: product_print_category +#: model_terms:ir.ui.view,arch_db:product_print_category.qweb_template_demo_1 +#: model_terms:ir.ui.view,arch_db:product_print_category.qweb_template_demo_2 +msgid "Price:" +msgstr "Prezzo:" + +#. module: product_print_category +#: model:ir.model,name:product_print_category.model_product_print_category_mixin +msgid "Abstract Model for Product Print Categories" +msgstr "Modello astratto per categorie stampa prodotto" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category__active +msgid "Active" +msgstr "Attiva" + +#. module: product_print_category +#: model_terms:ir.ui.view,arch_db:product_print_category.view_product_print_wizard_form +msgid "Cancel" +msgstr "Annulla" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category__company_id +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category_rule__company_id +msgid "Company" +msgstr "Azienda" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category__create_uid +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category_rule__create_uid +#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard__create_uid +#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard_line__create_uid +msgid "Created by" +msgstr "Creato da" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category__create_date +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category_rule__create_date +#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard__create_date +#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard_line__create_date +msgid "Created on" +msgstr "Creato il" + +#. module: product_print_category +#: model:product.print.category,name:product_print_category.demo_category_1 +msgid "Demo Category 1" +msgstr "Categoria demo 1" + +#. module: product_print_category +#: model:product.print.category,name:product_print_category.demo_category_2 +msgid "Demo Category 2" +msgstr "Categoria demo 2" + +#. module: product_print_category +#: model:product.template,name:product_print_category.demo_product_1_product_template +msgid "Demo Product With Print category 1" +msgstr "Prodotto demo con categoria stampa 1" + +#. module: product_print_category +#: model:product.template,name:product_print_category.demo_product_2_product_template +msgid "Demo Product With Print category 2" +msgstr "Prodotto demo con categoria stampa 2" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category__display_name +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category_rule__display_name +#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard__display_name +#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard_line__display_name +msgid "Display Name" +msgstr "Nome visualizzato" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category__field_ids +msgid "Fields related to printing" +msgstr "Campi relativi alla stampa" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category__id +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category_rule__id +#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard__id +#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard_line__id +msgid "ID" +msgstr "ID" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category____last_update +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category_rule____last_update +#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard____last_update +#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard_line____last_update +msgid "Last Modified on" +msgstr "Ultima modifica il" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category__write_uid +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category_rule__write_uid +#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard__write_uid +#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard_line__write_uid +msgid "Last Updated by" +msgstr "Ultimo aggiornamento di" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category__write_date +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category_rule__write_date +#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard__write_date +#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard_line__write_date +msgid "Last Updated on" +msgstr "Ultimo aggiornamento il" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard__line_ids +msgid "Lines" +msgstr "Righe" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category_rule__main_category_id +msgid "Main Category" +msgstr "Categoria principale" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category__name +#: model_terms:ir.ui.view,arch_db:product_print_category.view_product_print_category_form_2 +msgid "Name" +msgstr "Nome" + +#. module: product_print_category +#. odoo-python +#: code:addons/product_print_category/wizard/product_print_wizard.py:0 +#, python-format +msgid "" +"Please set a print category for the following lines \n" +"\n" +"- %s" +msgstr "" +"Impostare una categoria stampa per le seguenti righe \n" +"\n" +"- %s" + +#. module: product_print_category +#: model:ir.model,name:product_print_category.model_report_product_print_category_report_pricetag +msgid "Pricetag report" +msgstr "Resoconto etichetta prezzo" + +#. module: product_print_category +#: model:ir.actions.report,name:product_print_category.pricetag +msgid "Pricetags" +msgstr "Etichette prezzo" + +#. module: product_print_category +#: model_terms:ir.ui.view,arch_db:product_print_category.view_product_print_wizard_form +msgid "Print" +msgstr "Stampa" + +#. module: product_print_category +#: model_terms:ir.ui.view,arch_db:product_print_category.view_product_print_category_form_2 +msgid "Print All Products" +msgstr "Stampa tutti i prodotti" + +#. module: product_print_category +#: model:ir.actions.act_window,name:product_print_category.action_product_print_category +#: model:ir.ui.menu,name:product_print_category.menu_product_print_category +msgid "Print Categories" +msgstr "Categorie stampa" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category_rule__print_category_id +#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard_line__print_category_id +#: model:ir.model.fields,field_description:product_print_category.field_product_product__print_category_id +#: model:ir.model.fields,field_description:product_print_category.field_product_template__print_category_id +msgid "Print Category" +msgstr "Ctegoria stampa" + +#. module: product_print_category +#: model:res.groups,name:product_print_category.manager +msgid "Print Category Manager" +msgstr "Responsabile categoria stampa" + +#. module: product_print_category +#: model:ir.actions.act_window,name:product_print_category.action_product_print_category_rule +#: model:ir.ui.menu,name:product_print_category.menu_product_print_category_rule +msgid "Print Category Rules" +msgstr "Regole categoria stampa" + +#. module: product_print_category +#: model:ir.model,name:product_print_category.model_product_print_category_rule +msgid "Print Category Rules for Product" +msgstr "Regole categoria stampa per il prodotto" + +#. module: product_print_category +#: model:ir.model,name:product_print_category.model_product_print_category +msgid "Print Category for Product" +msgstr "Categoria stampa per il prodotto" + +#. module: product_print_category +#: model_terms:ir.ui.view,arch_db:product_print_category.view_product_print_category_form_2 +msgid "Print Obsolete Products" +msgstr "Stampa prdotti obsoleti" + +#. module: product_print_category +#: model:ir.actions.act_window,name:product_print_category.action_product_product_2_product_print_wizard +#: model:ir.actions.act_window,name:product_print_category.action_product_template_2_product_print_wizard +#: model_terms:ir.ui.view,arch_db:product_print_category.view_product_print_wizard_form +msgid "Print Products" +msgstr "Stampa prodotti" + +#. module: product_print_category +#: model_terms:ir.ui.view,arch_db:product_print_category.view_product_print_category_form_2 +msgid "Print category name" +msgstr "Nome categoria stampa" + +#. module: product_print_category +#: model_terms:ir.ui.view,arch_db:product_print_category.view_product_template_only_form +msgid "Print options should be configured on Product Variants" +msgstr "Le opzioni di stampa devono essere configurate sulle varianti prodotto" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category_rule__sequence +msgid "Priority" +msgstr "Priorità" + +#. module: product_print_category +#: model:ir.model,name:product_print_category.model_product_template +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category__product_ids +#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard_line__product_id +msgid "Product" +msgstr "Prodotto" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category__product_to_print_ids +msgid "Product To Print" +msgstr "Prodotto da stampare" + +#. module: product_print_category +#: model:ir.model,name:product_print_category.model_product_product +msgid "Product Variant" +msgstr "Variante prodotto" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category__product_qty +msgid "Products" +msgstr "Prodotti" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category__product_to_print_qty +msgid "Products To Print" +msgstr "Prodotti da stampare" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard_line__quantity +msgid "Quantity" +msgstr "Quantità" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category__qweb_view_id +msgid "Qweb View" +msgstr "Vista Qweb" + +#. module: product_print_category +#: model:ir.model.fields,help:product_print_category.field_product_print_category_rule__company_id +msgid "Restrict the access of this rule to the given company" +msgstr "Restringe l'accesso di questa regola all'azienda indicata" + +#. module: product_print_category +#: model:ir.model.fields,help:product_print_category.field_product_print_category_rule__main_category_id +msgid "" +"This rule will be applied only to products that belong to the given " +"category, or to its children." +msgstr "" +"La regola si applicherà solo ai prodotti che appartengono alla categoria " +"indicata o ai loro figli." + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_product__to_print +#: model:ir.model.fields,field_description:product_print_category.field_product_template__to_print +msgid "To Print" +msgstr "Da stampare" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard_line__wizard_id +msgid "Wizard" +msgstr "Procedura guidata" + +#. module: product_print_category +#: model:ir.model,name:product_print_category.model_product_print_wizard +msgid "Wizard for printing products" +msgstr "Procedura guidata per stampare prodotti" + +#. module: product_print_category +#: model:ir.model,name:product_print_category.model_product_print_wizard_line +msgid "Wizard line for printing products" +msgstr "Riga procedura guidata per stampare prodotti" + +#. module: product_print_category +#: model_terms:ir.ui.view,arch_db:product_print_category.view_product_print_wizard_form +msgid "⚠️ If you change Print Category here, it will be changed in the product." +msgstr "⚠️ Se si cambia qui la categoria stampa, verrà cambiata nel prodotto." diff --git a/product_print_category/i18n/product_print_category.pot b/product_print_category/i18n/product_print_category.pot new file mode 100644 index 00000000000..a307c12c1a7 --- /dev/null +++ b/product_print_category/i18n/product_print_category.pot @@ -0,0 +1,327 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_print_category +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \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: product_print_category +#: model:ir.actions.report,print_report_name:product_print_category.pricetag +msgid "'Products Labels'" +msgstr "" + +#. module: product_print_category +#: model_terms:ir.ui.view,arch_db:product_print_category.view_product_print_category_form_2 +msgid "Products" +msgstr "" + +#. module: product_print_category +#: model_terms:ir.ui.view,arch_db:product_print_category.view_product_print_category_form_2 +msgid "To print" +msgstr "" + +#. module: product_print_category +#: model_terms:ir.ui.view,arch_db:product_print_category.qweb_template_demo_1 +#: model_terms:ir.ui.view,arch_db:product_print_category.qweb_template_demo_2 +msgid "Code:" +msgstr "" + +#. module: product_print_category +#: model_terms:ir.ui.view,arch_db:product_print_category.qweb_template_demo_1 +#: model_terms:ir.ui.view,arch_db:product_print_category.qweb_template_demo_2 +msgid "Price:" +msgstr "" + +#. module: product_print_category +#: model:ir.model,name:product_print_category.model_product_print_category_mixin +msgid "Abstract Model for Product Print Categories" +msgstr "" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category__active +msgid "Active" +msgstr "" + +#. module: product_print_category +#: model_terms:ir.ui.view,arch_db:product_print_category.view_product_print_wizard_form +msgid "Cancel" +msgstr "" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category__company_id +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category_rule__company_id +msgid "Company" +msgstr "" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category__create_uid +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category_rule__create_uid +#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard__create_uid +#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard_line__create_uid +msgid "Created by" +msgstr "" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category__create_date +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category_rule__create_date +#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard__create_date +#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard_line__create_date +msgid "Created on" +msgstr "" + +#. module: product_print_category +#: model:product.print.category,name:product_print_category.demo_category_1 +msgid "Demo Category 1" +msgstr "" + +#. module: product_print_category +#: model:product.print.category,name:product_print_category.demo_category_2 +msgid "Demo Category 2" +msgstr "" + +#. module: product_print_category +#: model:product.template,name:product_print_category.demo_product_1_product_template +msgid "Demo Product With Print category 1" +msgstr "" + +#. module: product_print_category +#: model:product.template,name:product_print_category.demo_product_2_product_template +msgid "Demo Product With Print category 2" +msgstr "" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category__display_name +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category_rule__display_name +#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard__display_name +#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard_line__display_name +msgid "Display Name" +msgstr "" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category__field_ids +msgid "Fields related to printing" +msgstr "" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category__id +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category_rule__id +#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard__id +#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard_line__id +msgid "ID" +msgstr "" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category____last_update +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category_rule____last_update +#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard____last_update +#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard_line____last_update +msgid "Last Modified on" +msgstr "" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category__write_uid +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category_rule__write_uid +#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard__write_uid +#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard_line__write_uid +msgid "Last Updated by" +msgstr "" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category__write_date +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category_rule__write_date +#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard__write_date +#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard_line__write_date +msgid "Last Updated on" +msgstr "" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard__line_ids +msgid "Lines" +msgstr "" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category_rule__main_category_id +msgid "Main Category" +msgstr "" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category__name +#: model_terms:ir.ui.view,arch_db:product_print_category.view_product_print_category_form_2 +msgid "Name" +msgstr "" + +#. module: product_print_category +#. odoo-python +#: code:addons/product_print_category/wizard/product_print_wizard.py:0 +#, python-format +msgid "" +"Please set a print category for the following lines \n" +"\n" +"- %s" +msgstr "" + +#. module: product_print_category +#: model:ir.model,name:product_print_category.model_report_product_print_category_report_pricetag +msgid "Pricetag report" +msgstr "" + +#. module: product_print_category +#: model:ir.actions.report,name:product_print_category.pricetag +msgid "Pricetags" +msgstr "" + +#. module: product_print_category +#: model_terms:ir.ui.view,arch_db:product_print_category.view_product_print_wizard_form +msgid "Print" +msgstr "" + +#. module: product_print_category +#: model_terms:ir.ui.view,arch_db:product_print_category.view_product_print_category_form_2 +msgid "Print All Products" +msgstr "" + +#. module: product_print_category +#: model:ir.actions.act_window,name:product_print_category.action_product_print_category +#: model:ir.ui.menu,name:product_print_category.menu_product_print_category +msgid "Print Categories" +msgstr "" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category_rule__print_category_id +#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard_line__print_category_id +#: model:ir.model.fields,field_description:product_print_category.field_product_product__print_category_id +#: model:ir.model.fields,field_description:product_print_category.field_product_template__print_category_id +msgid "Print Category" +msgstr "" + +#. module: product_print_category +#: model:res.groups,name:product_print_category.manager +msgid "Print Category Manager" +msgstr "" + +#. module: product_print_category +#: model:ir.actions.act_window,name:product_print_category.action_product_print_category_rule +#: model:ir.ui.menu,name:product_print_category.menu_product_print_category_rule +msgid "Print Category Rules" +msgstr "" + +#. module: product_print_category +#: model:ir.model,name:product_print_category.model_product_print_category_rule +msgid "Print Category Rules for Product" +msgstr "" + +#. module: product_print_category +#: model:ir.model,name:product_print_category.model_product_print_category +msgid "Print Category for Product" +msgstr "" + +#. module: product_print_category +#: model_terms:ir.ui.view,arch_db:product_print_category.view_product_print_category_form_2 +msgid "Print Obsolete Products" +msgstr "" + +#. module: product_print_category +#: model:ir.actions.act_window,name:product_print_category.action_product_product_2_product_print_wizard +#: model:ir.actions.act_window,name:product_print_category.action_product_template_2_product_print_wizard +#: model_terms:ir.ui.view,arch_db:product_print_category.view_product_print_wizard_form +msgid "Print Products" +msgstr "" + +#. module: product_print_category +#: model_terms:ir.ui.view,arch_db:product_print_category.view_product_print_category_form_2 +msgid "Print category name" +msgstr "" + +#. module: product_print_category +#: model_terms:ir.ui.view,arch_db:product_print_category.view_product_template_only_form +msgid "Print options should be configured on Product Variants" +msgstr "" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category_rule__sequence +msgid "Priority" +msgstr "" + +#. module: product_print_category +#: model:ir.model,name:product_print_category.model_product_template +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category__product_ids +#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard_line__product_id +msgid "Product" +msgstr "" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category__product_to_print_ids +msgid "Product To Print" +msgstr "" + +#. module: product_print_category +#: model:ir.model,name:product_print_category.model_product_product +msgid "Product Variant" +msgstr "" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category__product_qty +msgid "Products" +msgstr "" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category__product_to_print_qty +msgid "Products To Print" +msgstr "" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard_line__quantity +msgid "Quantity" +msgstr "" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_category__qweb_view_id +msgid "Qweb View" +msgstr "" + +#. module: product_print_category +#: model:ir.model.fields,help:product_print_category.field_product_print_category_rule__company_id +msgid "Restrict the access of this rule to the given company" +msgstr "" + +#. module: product_print_category +#: model:ir.model.fields,help:product_print_category.field_product_print_category_rule__main_category_id +msgid "" +"This rule will be applied only to products that belong to the given " +"category, or to its children." +msgstr "" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_product__to_print +#: model:ir.model.fields,field_description:product_print_category.field_product_template__to_print +msgid "To Print" +msgstr "" + +#. module: product_print_category +#: model:ir.model.fields,field_description:product_print_category.field_product_print_wizard_line__wizard_id +msgid "Wizard" +msgstr "" + +#. module: product_print_category +#: model:ir.model,name:product_print_category.model_product_print_wizard +msgid "Wizard for printing products" +msgstr "" + +#. module: product_print_category +#: model:ir.model,name:product_print_category.model_product_print_wizard_line +msgid "Wizard line for printing products" +msgstr "" + +#. module: product_print_category +#: model_terms:ir.ui.view,arch_db:product_print_category.view_product_print_wizard_form +msgid "" +"⚠️ If you change Print Category here, it will be changed in the product." +msgstr "" diff --git a/product_print_category/models/__init__.py b/product_print_category/models/__init__.py new file mode 100644 index 00000000000..911d252d010 --- /dev/null +++ b/product_print_category/models/__init__.py @@ -0,0 +1,5 @@ +from . import product_print_category +from . import product_print_category_mixin +from . import product_print_category_rule +from . import product_product +from . import product_template diff --git a/product_print_category/models/product_print_category.py b/product_print_category/models/product_print_category.py new file mode 100644 index 00000000000..3f7902d90ec --- /dev/null +++ b/product_print_category/models/product_print_category.py @@ -0,0 +1,94 @@ +# Copyright (C) 2016-Today: La Louve () +# Copyright (C) 2022-Today: GRAP (http://www.grap.coop) +# @author: Sylvain LE GAL (https://twitter.com/legalsylvain) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import api, fields, models +from odoo.osv import expression + + +class ProductPrintCategory(models.Model): + _name = "product.print.category" + _description = "Print Category for Product" + _order = "name" + + # Fields Section + name = fields.Char(required=True, translate=True) + + active = fields.Boolean(default=True) + + company_id = fields.Many2one( + string="Company", + comodel_name="res.company", + index=True, + default=lambda x: x._default_company_id(), + ) + + product_ids = fields.One2many( + comodel_name="product.product", inverse_name="print_category_id" + ) + + product_qty = fields.Integer(string="Products", compute="_compute_product_qty") + + product_to_print_ids = fields.One2many( + comodel_name="product.product", + compute="_compute_to_print", + ) + + product_to_print_qty = fields.Integer( + compute="_compute_to_print", + string="Products To Print", + ) + + field_ids = fields.Many2many( + string="Fields related to printing", + comodel_name="ir.model.fields", + column1="category_id", + column2="field_id", + domain="['|', ('model', '=', 'product.product'),\ + ('model', '=', 'product.product')]", + ) + + qweb_view_id = fields.Many2one( + comodel_name="ir.ui.view", + string="Qweb View", + domain="[('type', '=', 'qweb')]", + required=True, + ) + + def _default_company_id(self): + return self.env.company + + def get_xml_id_view(self): + return self.qweb_view_id.sudo().key + + # Compute Section + @api.depends("product_ids.print_category_id") + def _compute_product_qty(self): + for category in self: + category.product_qty = len(category.product_ids) + + def _compute_to_print(self): + product_obj = self.env["product.product"] + for category in self: + products = product_obj.search( + [ + ("print_category_id", "=", category.id), + ("to_print", "=", True), + ] + ) + category.product_to_print_qty = len(products) + category.product_to_print_ids = products + + # Action Section + def action_view_product_product(self): + self.ensure_one() + action = self.env["ir.actions.actions"]._for_xml_id( + "product.product_normal_action" + ) + action["domain"] = [("print_category_id", "=", self.id)] + if self.env.context.get("to_print"): + action["domain"] = expression.AND( + [action["domain"], [("to_print", "=", True)]] + ) + return action diff --git a/product_print_category/models/product_print_category_mixin.py b/product_print_category/models/product_print_category_mixin.py new file mode 100644 index 00000000000..55edfdf9ae8 --- /dev/null +++ b/product_print_category/models/product_print_category_mixin.py @@ -0,0 +1,67 @@ +# Copyright (C) 2018-Today: La Louve () +# Copyright (C) 2022-Today: GRAP (http://www.grap.coop) +# @author: Sylvain LE GAL (https://twitter.com/legalsylvain) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import models + + +class ProductPrintCategoryMixin(models.AbstractModel): + _name = "product.print.category.mixin" + _description = "Abstract Model for Product Print Categories" + + def write(self, vals): + ProductProduct = self.env["product.product"].with_context( + active_test=False, to_print_ok=True + ) + ProductPrintCategory = self.env["product.print.category"] + + if "to_print" in vals or self.env.get("to_print_ok", False): + # "to_print" is explicitely set, nothing to do + # Or it is handled previously + return super( + ProductPrintCategoryMixin, self.with_context(to_print_ok=True) + ).write(vals) + + if "print_category_id" in vals: + # print_category_id changed, we set + # to print, if a category is set + # not to print if no category is set + vals["to_print"] = bool(vals["print_category_id"]) + return super( + ProductPrintCategoryMixin, self.with_context(to_print_ok=True) + ).write(vals) + + # Here we have to group by print_category_id + # and for each print_category_id we check if related fields changed + res = super( + ProductPrintCategoryMixin, self.with_context(to_print_ok=True) + ).write(vals) + + if self._name == "product.template": + domain = [ + ("product_tmpl_id", "in", self.ids), + ("print_category_id", "!=", False), + ] + elif self._name == "product.product": + domain = [ + ("print_category_id", "!=", False), + ] + else: + raise NotImplementedError() + product_groups = ProductProduct.read_group( + domain=domain, fields=["print_category_id"], groupby="print_category_id" + ) + products_to_update = ProductProduct + for product_group in product_groups: + category = ProductPrintCategory.browse( + product_group["print_category_id"][0] + ) + triggering_fields = category.field_ids.sudo().mapped("name") + if len(list(set(vals.keys()) & set(triggering_fields))): + # Value present in the label changed + products_to_update |= ProductProduct.search(product_group["__domain"]) + + if products_to_update: + products_to_update.write({"to_print": True}) + return res diff --git a/product_print_category/models/product_print_category_rule.py b/product_print_category/models/product_print_category_rule.py new file mode 100644 index 00000000000..10a6c1aa535 --- /dev/null +++ b/product_print_category/models/product_print_category_rule.py @@ -0,0 +1,52 @@ +# Copyright (C) 2023-Today: GRAP (http://www.grap.coop) +# @author: Sylvain LE GAL (https://twitter.com/legalsylvain) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import api, fields, models + + +class ProductPrintCategoryRule(models.Model): + _name = "product.print.category.rule" + _description = "Print Category Rules for Product" + _order = "sequence" + + sequence = fields.Integer(string="Priority", required=True) + + company_id = fields.Many2one( + string="Company", + comodel_name="res.company", + index=True, + default=lambda x: x._default_company_id(), + help="Restrict the access of this rule to the given company", + ) + + main_category_id = fields.Many2one( + string="Main Category", + comodel_name="product.category", + help="This rule will be applied only to products that belong to" + " the given category, or to its children.", + ) + + print_category_id = fields.Many2one( + comodel_name="product.print.category", + ) + + def _default_company_id(self): + return self.env.company + + @api.model + def get_print_category_rule(self, product): + # if the required field categ_id is not set + # we are in a creation process and there is + # no way to guess the print category at this step. + if not product.categ_id: + return False + + return self.search( + [ + "|", + ("main_category_id", "parent_of", product.categ_id.id), + ("main_category_id", "=", False), + ], + limit=1, + ) diff --git a/product_print_category/models/product_product.py b/product_print_category/models/product_product.py new file mode 100644 index 00000000000..6364b8fdb62 --- /dev/null +++ b/product_print_category/models/product_product.py @@ -0,0 +1,41 @@ +# Copyright (C) 2016-Today: La Louve () +# Copyright (C) 2022-Today: GRAP (http://www.grap.coop) +# @author: Sylvain LE GAL (https://twitter.com/legalsylvain) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import api, fields, models + + +class ProductProduct(models.Model): + _name = "product.product" + _inherit = ["product.product", "product.print.category.mixin"] + + # Columns Section + print_category_id = fields.Many2one( + string="Print Category", + comodel_name="product.print.category", + ) + + to_print = fields.Boolean() + + @api.onchange("categ_id", "company_id") + def _onchange_categ_id_company_id(self): + rule = self.env["product.print.category.rule"].get_print_category_rule(self) + if rule: + self.print_category_id = rule.print_category_id + + @api.onchange("print_category_id") + def onchange_print_category_id(self): + self.to_print = bool(self.print_category_id) + + @api.model_create_multi + def create(self, vals_list): + if not self.env.context.get("to_print_ok", False): + for vals in vals_list: + # if not explicitely defined, we guess "to_print" value, + # based on the print_category_id value. + if "to_print" not in vals: + vals["to_print"] = bool(vals.get("print_category_id", False)) + return super(ProductProduct, self.with_context(to_print_ok=True)).create( + vals_list + ) diff --git a/product_print_category/models/product_template.py b/product_print_category/models/product_template.py new file mode 100644 index 00000000000..2346e72c655 --- /dev/null +++ b/product_print_category/models/product_template.py @@ -0,0 +1,68 @@ +# Copyright (C) 2021-Today: Coop IT Easy () +# Copyright (C) 2022-Today: GRAP (http://www.grap.coop) +# @author: Rémy TAYMANS () +# @author: Sylvain LE GAL (https://twitter.com/legalsylvain) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import api, fields, models + + +class ProductTemplate(models.Model): + _name = "product.template" + _inherit = ["product.template", "product.print.category.mixin"] + + print_category_id = fields.Many2one( + string="Print Category", + comodel_name="product.print.category", + compute="_compute_print_category_id", + inverse="_inverse_print_category_id", + ) + + to_print = fields.Boolean(compute="_compute_to_print", inverse="_inverse_to_print") + + def _get_related_fields_variant_template(self): + res = super()._get_related_fields_variant_template() + res += ["print_category_id", "to_print"] + return res + + @api.onchange("categ_id", "company_id") + def _onchange_categ_id_company_id(self): + rule = self.env["product.print.category.rule"].get_print_category_rule(self) + if rule: + self.print_category_id = rule.print_category_id + + @api.onchange("print_category_id") + def onchange_print_category_id(self): + self.to_print = bool(self.print_category_id) + + @api.depends("product_variant_ids", "product_variant_ids.print_category_id") + def _compute_print_category_id(self): + unique_variants = self.filtered( + lambda template: len(template.product_variant_ids) == 1 + ) + for template in unique_variants: + template.print_category_id = template.product_variant_ids.print_category_id + for template in self - unique_variants: + template.print_category_id = False + + def _inverse_print_category_id(self): + for template in self: + if len(template.product_variant_ids) == 1: + template.product_variant_ids.print_category_id = ( + template.print_category_id + ) + + @api.depends("product_variant_ids", "product_variant_ids.to_print") + def _compute_to_print(self): + unique_variants = self.filtered( + lambda template: len(template.product_variant_ids) == 1 + ) + for template in unique_variants: + template.to_print = template.product_variant_ids.to_print + for template in self - unique_variants: + template.to_print = False + + def _inverse_to_print(self): + for template in self: + if len(template.product_variant_ids) == 1: + template.product_variant_ids.to_print = template.to_print diff --git a/product_print_category/pyproject.toml b/product_print_category/pyproject.toml new file mode 100644 index 00000000000..4231d0cccb3 --- /dev/null +++ b/product_print_category/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/product_print_category/readme/CONFIGURE.md b/product_print_category/readme/CONFIGURE.md new file mode 100644 index 00000000000..96315e0c4d0 --- /dev/null +++ b/product_print_category/readme/CONFIGURE.md @@ -0,0 +1,38 @@ +**Group setting** + +- Add yourself to the 'Print Category Manager' group in the 'Pricetags' + category. + +**Create Print Categories** + +- Go to 'Sales' \> 'Products' \> 'Print Categories' + +- Find or create new print categories of products + - Set the fields that will trigger to print again the product label + (e.g : name, sale price etc.) + - Set the qweb view that will be used for this category + +![image1](../static/description/product_print_category_form.png) + +Alternatively, you can create product print categories and qweb in a +custom module. + +**Affect products to the categories** + +- Go to "Sales" \> "Products" \> "Product variants" (or "Products" if + variants are not activated). +- Go to your product in General Information tab +- Set a print category + +![image2](../static/description/product_product_form.png) + +**Create Print Category Rules** + +- Go to 'Sales' \> 'Products' \> 'Print Category Rules' + +Create various ordered rules depending on product category and company. + +This system allow to automatically set / remove print category to a +product, when changing its company or its category. + +![image3](../static/description/product_print_category_rule_tree.png) diff --git a/product_print_category/readme/CONTRIBUTORS.md b/product_print_category/readme/CONTRIBUTORS.md new file mode 100644 index 00000000000..c93e728fc4b --- /dev/null +++ b/product_print_category/readme/CONTRIBUTORS.md @@ -0,0 +1,4 @@ +- Sylvain LE GAL \<\> +- Quentin DUPONT \<\> +- [Binhex](https://binhex.cloud/): + - Mario Luis \<\> diff --git a/product_print_category/readme/DESCRIPTION.md b/product_print_category/readme/DESCRIPTION.md new file mode 100644 index 00000000000..80b7e5a86d8 --- /dev/null +++ b/product_print_category/readme/DESCRIPTION.md @@ -0,0 +1,9 @@ +This module is designed to extend product printing features. It allows +user to create new print categories of products depending of the data +that are on the labels of the products variants. + +When a field has changed, the product will be set as 'To print' +automatically. + +This module requires to install custom modules to have pricetags +templates, or alternatively to create pricetag reports templates by UI. diff --git a/product_print_category/readme/USAGE.md b/product_print_category/readme/USAGE.md new file mode 100644 index 00000000000..9236f6d6385 --- /dev/null +++ b/product_print_category/readme/USAGE.md @@ -0,0 +1,7 @@ +- Go to "Sales" \> "Products" \> "Print Categories" +- Choose between "Print Obsolete Products" or "Print All Products" + +![image4](../static/description/product_print_wizard_form.png) + +- Alternatively you can select product in product or variants list view + and click on "Action" \> "Print Products" diff --git a/product_print_category/report/__init__.py b/product_print_category/report/__init__.py new file mode 100644 index 00000000000..000e9934289 --- /dev/null +++ b/product_print_category/report/__init__.py @@ -0,0 +1 @@ +from . import report_pricetag diff --git a/product_print_category/report/ir_actions_report.xml b/product_print_category/report/ir_actions_report.xml new file mode 100644 index 00000000000..5041a7558de --- /dev/null +++ b/product_print_category/report/ir_actions_report.xml @@ -0,0 +1,21 @@ + + + + + + Pricetags + product.print.wizard.line + qweb-pdf + product_print_category.report_pricetag + product_print_category.report_pricetag + + 'Products Labels' + + report + + + diff --git a/product_print_category/report/report_pricetag.py b/product_print_category/report/report_pricetag.py new file mode 100644 index 00000000000..70116efba9e --- /dev/null +++ b/product_print_category/report/report_pricetag.py @@ -0,0 +1,47 @@ +from odoo import api, models + + +class ReportPricetag(models.AbstractModel): + _name = "report.product_print_category.report_pricetag" + _description = "Pricetag report" + + @api.model + def _get_report_values(self, docids, data=None): + WizardLine = self.env["product.print.wizard.line"] + # Prepare data to print + docargs = { + "categories_data": self._prepare_categories_data(docids, data=data), + } + + # mark the selected products as Up To Date if print succeed + lines = WizardLine.browse(docids) + lines.mapped("product_id").write({"to_print": False}) + return docargs + + @api.model + def _prepare_categories_data(self, docids, data=None): + PrintCategory = self.env["product.print.category"] + WizardLine = self.env["product.print.wizard.line"] + + # ordering data to print + lines_dict = {} + for line_id in docids: + line = WizardLine.browse(int(line_id)) + category = line.product_id.print_category_id + if category.id not in lines_dict: + lines_dict[category.id] = [line.id] + else: + lines_dict[category.id].append(line.id) + + # Computing data to transfer + categories_data = [] + for category_id, line_ids in lines_dict.items(): + category = PrintCategory.browse(category_id) + categories_data.append( + { + "print_category": category, + "report_model": "report_pricetag_custom", + "lines": WizardLine.browse(line_ids), + } + ) + return categories_data diff --git a/product_print_category/report/report_pricetag.xml b/product_print_category/report/report_pricetag.xml new file mode 100644 index 00000000000..936e411721f --- /dev/null +++ b/product_print_category/report/report_pricetag.xml @@ -0,0 +1,21 @@ + + + + + + + diff --git a/product_print_category/security/ir.model.access.csv b/product_print_category/security/ir.model.access.csv new file mode 100644 index 00000000000..b3be976c72f --- /dev/null +++ b/product_print_category/security/ir.model.access.csv @@ -0,0 +1,7 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +ir_model_access_product_print_category_user,Print Category User,product_print_category.model_product_print_category,base.group_user,1,0,0,0 +ir_model_access_product_print_category_manager,Print Category Manager,product_print_category.model_product_print_category,product_print_category.manager,1,1,1,1 +product_print_category.access_product_print_wizard,access_product_print_wizard,product_print_category.model_product_print_wizard,base.group_user,1,1,1,1 +product_print_category.access_product_print_wizard_line,access_product_print_wizard_line,product_print_category.model_product_print_wizard_line,base.group_user,1,1,1,1 +ir_model_access_product_print_category_rule_user,Print Category Rule User,product_print_category.model_product_print_category_rule,,1,0,0,0 +ir_model_access_product_print_category_rule_manager,Print Category Rule Manager,product_print_category.model_product_print_category_rule,product_print_category.manager,1,1,1,1 diff --git a/product_print_category/security/ir_rule.xml b/product_print_category/security/ir_rule.xml new file mode 100644 index 00000000000..ad5311f41f7 --- /dev/null +++ b/product_print_category/security/ir_rule.xml @@ -0,0 +1,33 @@ + + + + + Product Print Category Rule + + + + [ + '|', + ('company_id','=',False), + ('company_id', 'in', company_ids) + ] + + + + + Product Print Category Rule Rule + + + + [ + '|', + ('company_id','=',False), + ('company_id', 'in', company_ids) + ] + + + diff --git a/product_print_category/security/res_groups.xml b/product_print_category/security/res_groups.xml new file mode 100644 index 00000000000..ea1e797de75 --- /dev/null +++ b/product_print_category/security/res_groups.xml @@ -0,0 +1,15 @@ + + + + + + Print Category Manager + + + + diff --git a/product_print_category/static/description/icon.png b/product_print_category/static/description/icon.png new file mode 100644 index 00000000000..3a0328b516c Binary files /dev/null and b/product_print_category/static/description/icon.png differ diff --git a/product_print_category/static/description/index.html b/product_print_category/static/description/index.html new file mode 100644 index 00000000000..fabba09b314 --- /dev/null +++ b/product_print_category/static/description/index.html @@ -0,0 +1,486 @@ + + + + + +Product - Print Categories + + + +
+

Product - Print Categories

+ + +

Beta License: AGPL-3 OCA/product-attribute Translate me on Weblate Try me on Runboat

+

This module is designed to extend product printing features. It allows +user to create new print categories of products depending of the data +that are on the labels of the products variants.

+

When a field has changed, the product will be set as ‘To print’ +automatically.

+

This module requires to install custom modules to have pricetags +templates, or alternatively to create pricetag reports templates by UI.

+

Table of contents

+ +
+

Configuration

+

Group setting

+
    +
  • Add yourself to the ‘Print Category Manager’ group in the ‘Pricetags’ +category.
  • +
+

Create Print Categories

+
    +
  • Go to ‘Sales’ > ‘Products’ > ‘Print Categories’
  • +
  • Find or create new print categories of products
      +
    • Set the fields that will trigger to print again the product label +(e.g : name, sale price etc.)
    • +
    • Set the qweb view that will be used for this category
    • +
    +
  • +
+

image1

+

Alternatively, you can create product print categories and qweb in a +custom module.

+

Affect products to the categories

+
    +
  • Go to “Sales” > “Products” > “Product variants” (or “Products” if +variants are not activated).
  • +
  • Go to your product in General Information tab
  • +
  • Set a print category
  • +
+

image2

+

Create Print Category Rules

+
    +
  • Go to ‘Sales’ > ‘Products’ > ‘Print Category Rules’
  • +
+

Create various ordered rules depending on product category and company.

+

This system allow to automatically set / remove print category to a +product, when changing its company or its category.

+

image3

+
+
+

Usage

+
    +
  • Go to “Sales” > “Products” > “Print Categories”
  • +
  • Choose between “Print Obsolete Products” or “Print All Products”
  • +
+

image4

+
    +
  • Alternatively you can select product in product or variants list view +and click on “Action” > “Print Products”
  • +
+
+
+

Bug Tracker

+

Bugs are tracked on GitHub 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.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • GRAP
  • +
  • La Louve
  • +
  • Coop IT Easy SC
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use.

+

Current maintainer:

+

legalsylvain

+

This module is part of the OCA/product-attribute project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/product_print_category/static/description/index.png b/product_print_category/static/description/index.png new file mode 100644 index 00000000000..90907f66b72 Binary files /dev/null and b/product_print_category/static/description/index.png differ diff --git a/product_print_category/static/description/product_print_category_form.png b/product_print_category/static/description/product_print_category_form.png new file mode 100644 index 00000000000..e6e10fdf22d Binary files /dev/null and b/product_print_category/static/description/product_print_category_form.png differ diff --git a/product_print_category/static/description/product_print_category_rule_tree.png b/product_print_category/static/description/product_print_category_rule_tree.png new file mode 100644 index 00000000000..94f7ecb01f3 Binary files /dev/null and b/product_print_category/static/description/product_print_category_rule_tree.png differ diff --git a/product_print_category/static/description/product_print_wizard_form.png b/product_print_category/static/description/product_print_wizard_form.png new file mode 100644 index 00000000000..11339162d69 Binary files /dev/null and b/product_print_category/static/description/product_print_wizard_form.png differ diff --git a/product_print_category/static/description/product_product_form.png b/product_print_category/static/description/product_product_form.png new file mode 100644 index 00000000000..bc6f9f71ff9 Binary files /dev/null and b/product_print_category/static/description/product_product_form.png differ diff --git a/product_print_category/tests/__init__.py b/product_print_category/tests/__init__.py new file mode 100644 index 00000000000..748c092c3ac --- /dev/null +++ b/product_print_category/tests/__init__.py @@ -0,0 +1 @@ +from . import test_product_print_category diff --git a/product_print_category/tests/test_product_print_category.py b/product_print_category/tests/test_product_print_category.py new file mode 100644 index 00000000000..5919683b4f5 --- /dev/null +++ b/product_print_category/tests/test_product_print_category.py @@ -0,0 +1,139 @@ +# Copyright (C) 2018 - Today: GRAP (http://www.grap.coop) +# @author: Sylvain LE GAL (https://twitter.com/legalsylvain) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo.tests.common import TransactionCase + + +class TestProductPrintCategory(TransactionCase): + """Tests for 'Product Print Category' Module""" + + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.ProductPrintWizard = cls.env["product.print.wizard"] + cls.ProductProduct = cls.env["product.product"] + cls.ProductTemplate = cls.env["product.template"] + cls.CustomReport = cls.env["report.product_print_category.report_pricetag"] + cls.print_category_1 = cls.env.ref("product_print_category.demo_category_1") + cls.print_category_2 = cls.env.ref("product_print_category.demo_category_2") + + # Test Section + def test_01_product_product_to_print_value(self): + product = self.ProductProduct.create( + { + "name": "Demo Product Product Name", + "print_category_id": self.print_category_1.id, + } + ) + self.assertEqual(product.to_print, True) + + product = self.ProductProduct.create( + { + "name": "Demo Product Product Name", + } + ) + self.assertEqual(product.to_print, False) + + product.print_category_id = self.print_category_1.id + self.assertEqual(product.to_print, True) + + product.to_print = False + product.name = "Demo Product Product Name Changed" + self.assertEqual(product.to_print, True) + + def test_02_product_template_to_print_value(self): + template = self.ProductTemplate.create( + { + "name": "Demo Product Product Name", + "print_category_id": self.print_category_1.id, + } + ) + self.assertEqual(template.to_print, True) + + template = self.ProductTemplate.create( + { + "name": "Demo Product Template Name", + } + ) + self.assertEqual(template.to_print, False) + + template.print_category_id = self.print_category_1.id + self.assertEqual(template.to_print, True) + + template.to_print = False + template.name = "Demo Product Template Name Changed" + self.assertEqual(template.to_print, True) + + def test_10_test_wizard_obsolete(self): + products = self.ProductProduct.search( + [ + ("to_print", "=", True), + ("print_category_id", "=", self.print_category_1.id), + ] + ) + self.assertTrue(len(products) > 0) + wizard = self.ProductPrintWizard.with_context( + active_model="product.print.category", + active_ids=[self.print_category_1.id], + ).create({}) + self.assertEqual( + len(wizard.line_ids), + len(products), + "Print obsolete product should propose 1 product", + ) + + wizard.print_report() + self.env.ref("product_print_category.pricetag")._render_qweb_pdf( + "product_print_category.report_pricetag", + wizard.line_ids.ids, + ) + + products = self.ProductProduct.search( + [ + ("to_print", "=", True), + ("print_category_id", "=", self.print_category_1.id), + ] + ) + self.assertTrue(len(products) == 0) + + def test_11_test_wizard_all(self): + products = self.ProductProduct.search( + [ + ("print_category_id", "=", self.print_category_1.id), + ] + ) + wizard = self.ProductPrintWizard.with_context( + active_model="product.print.category", + active_ids=[self.print_category_1.id], + all_products=True, + ).create({}) + + self.assertEqual( + len(wizard.line_ids), + len(products), + "Print all products should propose 3 products", + ) + + def test_21_onchange(self): + product = self.ProductProduct.create( + { + "name": "Demo Product Product Name", + } + ) + self.assertEqual(product.print_category_id.id, False) + + # check rule with exact setting + product.categ_id = self.env.ref("product.product_category_consumable") + product._onchange_categ_id_company_id() + self.assertEqual(product.print_category_id, self.print_category_2) + + # Test with child category setting + product.categ_id = self.env.ref("product.product_category_5") + product._onchange_categ_id_company_id() + self.assertEqual(product.print_category_id, self.print_category_1) + + # Test if fallback settings works + product.categ_id = self.env.ref("product.product_category_all") + product._onchange_categ_id_company_id() + self.assertEqual(product.print_category_id.id, False) diff --git a/product_print_category/views/view_product_print_category.xml b/product_print_category/views/view_product_print_category.xml new file mode 100644 index 00000000000..aaee617c167 --- /dev/null +++ b/product_print_category/views/view_product_print_category.xml @@ -0,0 +1,124 @@ + + + + + + product.print.category + + + + + + + + + + + + product.print.category + +
+
+
+ +
+ + + + +
+
+
+ + + + + + + + + + +
+
+
+
+ + + Print Categories + product.print.category + tree,form + + + + +
diff --git a/product_print_category/views/view_product_print_category_rule.xml b/product_print_category/views/view_product_print_category_rule.xml new file mode 100644 index 00000000000..d388e9147cc --- /dev/null +++ b/product_print_category/views/view_product_print_category_rule.xml @@ -0,0 +1,34 @@ + + + + + + product.print.category.rule + + + + + + + + + + + + Print Category Rules + product.print.category.rule + tree + + + + + diff --git a/product_print_category/views/view_product_product.xml b/product_print_category/views/view_product_product.xml new file mode 100644 index 00000000000..f3d9b0a928b --- /dev/null +++ b/product_print_category/views/view_product_product.xml @@ -0,0 +1,20 @@ + + + + + + product.product + + + + + + + + + + diff --git a/product_print_category/views/view_product_template.xml b/product_print_category/views/view_product_template.xml new file mode 100644 index 00000000000..46a3dc8e707 --- /dev/null +++ b/product_print_category/views/view_product_template.xml @@ -0,0 +1,30 @@ + + + + + + product.template + + + + + +

Print options should be configured on Product Variants

+
+
+
+ +
diff --git a/product_print_category/wizard/__init__.py b/product_print_category/wizard/__init__.py new file mode 100644 index 00000000000..36146ca0e5a --- /dev/null +++ b/product_print_category/wizard/__init__.py @@ -0,0 +1,2 @@ +from . import product_print_wizard +from . import product_print_wizard_line diff --git a/product_print_category/wizard/product_print_wizard.py b/product_print_category/wizard/product_print_wizard.py new file mode 100644 index 00000000000..823482db780 --- /dev/null +++ b/product_print_category/wizard/product_print_wizard.py @@ -0,0 +1,86 @@ +# Copyright (C) 2012-Today GRAP (http://www.grap.coop) +# @author Julien WESTE +# @author: Sylvain LE GAL (https://twitter.com/legalsylvain) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import _, api, fields, models +from odoo.exceptions import ValidationError + + +class ProductPrintWizard(models.TransientModel): + _name = "product.print.wizard" + _description = "Wizard for printing products" + + line_ids = fields.One2many( + comodel_name="product.print.wizard.line", + inverse_name="wizard_id", + string="Lines", + default=lambda s: s._default_line_ids(), + ) + + @api.model + def _default_line_ids(self): + lines_vals = [] + context = self.env.context + ProductProduct = self.env["product.product"] + if context.get("active_model", False) == "product.print.category": + domain = [ + ("print_category_id.id", "in", context.get("active_ids", [])), + ] + if not context.get("all_products", False): + domain.append(("to_print", "=", True)) + products = ProductProduct.search(domain) + + elif context.get("active_model", False) == "product.product": + product_ids = context.get("active_ids", []) + products = ProductProduct.browse(product_ids) + elif context.get("active_model", False) == "product.template": + template_ids = context.get("active_ids", []) + products = ProductProduct.search([("product_tmpl_id", "in", template_ids)]) + else: + return False + + for product in products: + lines_vals.append( + ( + 0, + 0, + { + "product_id": product.id, + "print_category_id": product.print_category_id.id, + "quantity": 1, + }, + ) + ) + return lines_vals + + def print_report(self): + self.ensure_one() + lines_without_category = self.mapped("line_ids").filtered( + lambda x: not x.print_category_id + ) + if lines_without_category: + raise ValidationError( + _("Please set a print category for the following lines \n\n- %s") + % ("\n- ".join(lines_without_category.mapped("product_id.name"))) + ) + self._prepare_data() + return self.env.ref("product_print_category.pricetag").report_action( + self.line_ids + ) + + def _prepare_data(self): + self.ensure_one() + return { + "line_data": [x.id for x in self.line_ids], + } + + def _prepare_product_data(self): + self.ensure_one() + product_data = {} + for line in self.line_ids: + if line.product_id.id not in product_data: + product_data[line.product_id.id] = line.quantity + else: + product_data[line.product_id.id] += line.quantity + return product_data diff --git a/product_print_category/wizard/product_print_wizard_line.py b/product_print_category/wizard/product_print_wizard_line.py new file mode 100644 index 00000000000..b8a0a22626d --- /dev/null +++ b/product_print_category/wizard/product_print_wizard_line.py @@ -0,0 +1,27 @@ +# Copyright (C) 2012-Today GRAP (http://www.grap.coop) +# @author Julien WESTE +# @author: Sylvain LE GAL (https://twitter.com/legalsylvain) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import fields, models + + +class ProductPrintWizardLine(models.TransientModel): + _name = "product.print.wizard.line" + _description = "Wizard line for printing products" + _rec_name = "product_id" + + wizard_id = fields.Many2one(comodel_name="product.print.wizard") + + product_id = fields.Many2one( + comodel_name="product.product", string="Product", required=True + ) + + print_category_id = fields.Many2one( + comodel_name="product.print.category", + string="Print Category", + related="product_id.print_category_id", + readonly=False, + ) + + quantity = fields.Integer(required=True, default=1) diff --git a/product_print_category/wizard/view_product_print_wizard.xml b/product_print_category/wizard/view_product_print_wizard.xml new file mode 100644 index 00000000000..9448e29f11b --- /dev/null +++ b/product_print_category/wizard/view_product_print_wizard.xml @@ -0,0 +1,62 @@ + + + + + + product.print.wizard + +
+

+ ⚠️ If you change Print Category here, it will be changed in the product. +

+ + + + + + + +
+
+
+
+
+ + + Print Products + product.print.wizard + form + new + + list,form + + + + Print Products + product.print.wizard + form + new + + list,form + + +