Skip to content

Commit

Permalink
Merge PR #1607 into 17.0
Browse files Browse the repository at this point in the history
Signed-off-by dreispt
  • Loading branch information
OCA-git-bot committed Aug 30, 2024
2 parents f1f15b1 + a79ac80 commit 8d9ec7d
Show file tree
Hide file tree
Showing 48 changed files with 3,281 additions and 0 deletions.
158 changes: 158 additions & 0 deletions product_print_category/README.rst
Original file line number Diff line number Diff line change
@@ -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 <https://github.com/OCA/product-attribute/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/product-attribute/issues/new?body=module:%20product_print_category%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

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

Credits
=======

Authors
-------

* GRAP
* La Louve
* Coop IT Easy SC

Contributors
------------

- Sylvain LE GAL <https://twitter.com/legalsylvain>
- Quentin DUPONT <https://twitter.com/pondupont>
- `Binhex <https://binhex.cloud/>`__:

- Mario Luis <[email protected]>

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 <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-legalsylvain|

This module is part of the `OCA/product-attribute <https://github.com/OCA/product-attribute/tree/17.0/product_print_category>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
3 changes: 3 additions & 0 deletions product_print_category/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from . import models
from . import wizard
from . import report
46 changes: 46 additions & 0 deletions product_print_category/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Copyright (C) 2012-Today GRAP (http://www.grap.coop)
# Copyright (C) 2016-Today: La Louve (<http://www.lalouve.net/>)
# Copyright (C) 2021-Today: Coop IT Easy (<http://coopiteasy.be/>)
# @author: Sylvain LE GAL (https://twitter.com/legalsylvain)
# @author: Rémy TAYMANS (<[email protected]>)
# 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,
}
22 changes: 22 additions & 0 deletions product_print_category/data/report_paperformat.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" ?>
<!--
Copyright (C) 2016-Today: La Louve (<http://www.lalouve.net/>)
@author: Sylvain LE GAL (https://twitter.com/legalsylvain)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
-->
<odoo>

<record id="paper_format" model="report.paperformat">
<field name="name">Products Print Format</field>
<field name="format">A4</field>
<field name="dpi">96</field>
<field name="orientation">Portrait</field>
<field name="margin_top">5</field>
<field name="margin_bottom">5</field>
<field name="margin_right">5</field>
<field name="margin_left">5</field>
<field name="header_spacing">0</field>
<field name="disable_shrinking" eval="True" />
</record>

</odoo>
34 changes: 34 additions & 0 deletions product_print_category/demo/product_print_category.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" ?>
<!--
Copyright (C) 2016-Today: La Louve (<http://www.lalouve.net/>)
@author: Sylvain LE GAL (https://twitter.com/legalsylvain)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
-->
<odoo>

<record model="product.print.category" id="demo_category_1">
<field name="name">Demo Category 1</field>
<field name="company_id" eval="False" />
<field
name="product_ids"
eval="[(4, ref('product.product_product_4')),(4, ref('product.product_product_5'))]"
/>
<field name="qweb_view_id" ref="qweb_template_demo_1" />
<field
name="field_ids"
eval="[(4, ref('product.field_product_product__name')),(4, ref('product.field_product_product__list_price'))]"
/>
</record>

<record model="product.print.category" id="demo_category_2">
<field name="name">Demo Category 2</field>
<field name="company_id" eval="False" />
<field name="product_ids" eval="[(4, ref('product.product_product_3'))]" />
<field name="qweb_view_id" ref="qweb_template_demo_2" />
<field
name="field_ids"
eval="[(4, ref('product.field_product_product__name')),(4, ref('product.field_product_product__list_price'))]"
/>
</record>

</odoo>
31 changes: 31 additions & 0 deletions product_print_category/demo/product_print_category_rule.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" ?>
<!--
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).
-->
<odoo>

<record model="product.print.category.rule" id="demo_rule_1">
<field name="sequence">1</field>
<field name="company_id" eval="False" />
<field name="main_category_id" ref="product.product_category_1" />
<field name="print_category_id" ref="demo_category_1" />
</record>

<record model="product.print.category.rule" id="demo_rule_2">
<field name="sequence">2</field>
<field name="company_id" eval="False" />
<field name="main_category_id" ref="product.product_category_consumable" />
<field name="print_category_id" ref="demo_category_2" />
</record>

<record model="product.print.category.rule" id="demo_rule_general">
<field name="sequence">100</field>
<field name="company_id" eval="False" />
<field name="main_category_id" ref="product.product_category_all" />
<field name="print_category_id" eval="False" />
</record>


</odoo>
19 changes: 19 additions & 0 deletions product_print_category/demo/product_product.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" ?>
<!--
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).
-->
<odoo>

<record model="product.product" id="demo_product_1">
<field name="name">Demo Product With Print category 1</field>
<field name="print_category_id" ref="demo_category_1" />
</record>

<record model="product.product" id="demo_product_2">
<field name="name">Demo Product With Print category 2</field>
<field name="print_category_id" ref="demo_category_2" />
</record>

</odoo>
61 changes: 61 additions & 0 deletions product_print_category/demo/qweb_template.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<?xml version="1.0" ?>
<!--
Copyright (C) 2016-Today: La Louve (<http://www.lalouve.net/>)
@author: Sylvain LE GAL (https://twitter.com/legalsylvain)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
-->
<odoo>

<template id="qweb_template_demo_1">
<t t-foreach="category_data['lines']" t-as="line">

<t t-foreach="line.quantity" t-as="q">
<div
style="border: 1px solid; background-color:#eee; display: inline-block; width: 200px; height: 100px; margin: 1em;"
>
<div>
<b><span t-field="line.product_id.name" /></b>
</div>
<div>
<t t-if="line.product_id.code">
<span style="color: #555;">Code:</span>
<span t-field="line.product_id.code" />
<br />
</t>
</div>
<div class="product_price">
<span style="color: #555;">Price:</span>
<span t-field="line.product_id.list_price" />
</div>
</div>
</t>
</t>
</template>

<template id="qweb_template_demo_2">
<t t-foreach="category_data['lines']" t-as="line">

<t t-foreach="line.quantity" t-as="q">
<div
style="border: 1px solid; background-color:#ee2; display: inline-block; width: 200px; height: 100px; margin: 1em;"
>
<div>
<b><span t-field="line.product_id.name" /></b>
</div>
<div>
<t t-if="line.product_id.code">
<span style="color: #555;">Code:</span>
<span t-field="line.product_id.code" />
<br />
</t>
</div>
<div class="product_price">
<span style="color: #555;">Price:</span>
<span t-field="line.product_id.list_price" />
</div>
</div>
</t>
</t>
</template>

</odoo>
Loading

0 comments on commit 8d9ec7d

Please sign in to comment.