Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[17.0] [MIG] product_print_category #1607

Merged
merged 25 commits into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
37b6bb7
[ADD] product_print_category : new module to set print categories on …
legalsylvain Oct 24, 2022
ebf0bba
[IMP] replace xml_id by key to make possible to use qweb created via …
legalsylvain Oct 26, 2022
397e71b
[IMP] Add onchange feature to make the UI more simple for end user an…
legalsylvain Jan 18, 2023
e383769
[IMP] product_print_category : Add product print category rule to hav…
legalsylvain Jan 18, 2023
8a8b3a2
[REF] product_print_category : do not creeate 'user' print Category G…
legalsylvain Feb 2, 2023
f2866c7
[FIX] product_print_category : make wizard working for non admin user
legalsylvain Feb 2, 2023
e3b08b4
[FIX] french trad of print_report_name
Feb 3, 2023
54714f5
[FIX] Remove useless apostrophe and fix fr.po file
legalsylvain Nov 6, 2023
f15f6b8
[REF] update readme and add index.html file
legalsylvain Nov 6, 2023
f40043d
[UPD] Update product_print_category.pot
Nov 6, 2023
8fee1d7
[BOT] post-merge updates
OCA-git-bot Nov 6, 2023
bef20ec
Added translation using Weblate (Italian)
mymage Nov 7, 2023
8e88d18
Translated using Weblate (Italian)
mymage Nov 7, 2023
6d0e8f7
Added translation using Weblate (Spanish)
Ivorra78 Nov 15, 2023
eca650d
Translated using Weblate (Spanish)
Ivorra78 Nov 15, 2023
c152ce1
[16.0][FIX] fix a security issue that prevents regular users to write…
nayatec Dec 12, 2023
e803f2c
[BOT] post-merge updates
OCA-git-bot Dec 12, 2023
02ea6d5
[FIX] product_print_category print report name
nayatec Apr 3, 2024
e4b6b84
[FIX] fix po files
nayatec Apr 8, 2024
0e424e5
[FIX] bug on escape in po file
nayatec Apr 16, 2024
9630fdf
[UPD] Update product_print_category.pot
Apr 16, 2024
89935ef
[BOT] post-merge updates
OCA-git-bot Apr 16, 2024
a5fdc38
Update translation files
weblate Apr 16, 2024
c823e96
[IMP] product_print_category: pre-commit auto fixes
May 6, 2024
a79ac80
[MIG] product_print_category: Migration to 17.0
May 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading