# Allow to print barcode of a product

**URL:** <https://discuss.tryton.org/t/allow-to-print-barcode-of-a-product/6359>\
**Category:** Feature\
**Created:** [July 20, 2023, 3:03pm UTC](https://discuss.tryton.org/t/allow-to-print-barcode-of-a-product/6359 "2023-07-20T15:03:57Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![pokoli](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/pokoli/32/22_2.png) [@pokoli](https://discuss.tryton.org/u/pokoli)\
**Post date:** [July 20, 2023, 3:03pm UTC](https://discuss.tryton.org/t/allow-to-print-barcode-of-a-product/6359/1 "2023-07-20T15:03:58Z")

</div>

## Rational

If we [Allow to scan product barcodes on sale point](https://discuss.tryton.org/t/allow-to-scan-product-barcodes-on-sale-point/6351) it will be great to have a report to print the barcode for products directly from tryton

## Proposal

Define in product configuration, the field to be used as barcode for product. This can be one of the following:

- Product Code
- One specific Type of Identifier.

Also we should define the desired Barcode format, which should be one of the implemented in [Barcode Reports](https://discuss.tryton.org/t/barcode-reports/5421)

Once the user selects such configuration we can have a libreoffice template which prints the product name and barcode. The report can be printed directly from products or from variants, so users with single product do not need to open the variant action.

## Implementation

---

<div class="post-metadata">

**Author:** ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)\
**Post date:** [July 20, 2023, 3:14pm UTC](https://discuss.tryton.org/t/allow-to-print-barcode-of-a-product/6359/2 "2023-07-20T15:14:25Z")

</div>

> [@pokoli](#):
>
> it will be great to have a report to print the barcode for products directly from tryton

Could you provide a use case?

> [@pokoli](#):
>
> This can be one of the following:
> 
> - Product Code
> - One specific Type of Identifier.
> - Barcode format, one of the implemented in [Barcode Reports](https://discuss.tryton.org/t/barcode-reports/5421)

I do not understand one of this specify a barcode.

> [@pokoli](#):
>
> Once the user selects such configuration we can have a libreoffice template which prints the product name and barcode.

What is the format and the size?

What does such complexe setup could be better than just define a report from the UI with the exact needed format and size?

---

<div class="post-metadata">

**Author:** ![pokoli](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/pokoli/32/22_2.png) [@pokoli](https://discuss.tryton.org/u/pokoli)\
**Post date:** [July 20, 2023, 3:18pm UTC](https://discuss.tryton.org/t/allow-to-print-barcode-of-a-product/6359/3 "2023-07-20T15:18:59Z")

</div>

> [@ced](#):
>
> > [@pokoli](#):
> >
> > it will be great to have a report to print the barcode for products directly from tryton
> 
> Could you provide a use case?

Print the EAN code to a product to be able to scan it latter.

> [@ced](#):
>
> I do not understand one of this specify a barcode.

Sorry but I do not understand what do you understand. Could you please clarify?

> [@ced](#):
>
> > [@pokoli](#):
> >
> > Once the user selects such configuration we can have a libreoffice template which prints the product name and barcode.
> 
> What is the format and the size?

I think we can have a small barcode format. Probably just 4cms width. One may adjust the format if needed.

> [@ced](#):
>
> What does such complexe setup could be better than just define a report from the UI with the exact needed format and size?

Because users just need to pick the desired configuration and they will have a barcode with a sample format.  
From there they can just adjust the template to their needs.  
Otherwise they won’t know which functions they need to call nor which fields to use (sometimes even they won’t know how to create the report).

---

<div class="post-metadata">

**Author:** ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)\
**Post date:** [July 20, 2023, 3:26pm UTC](https://discuss.tryton.org/t/allow-to-print-barcode-of-a-product/6359/4 "2023-07-20T15:26:15Z")

</div>

> [@pokoli](#):
>
> Print the EAN code to a product to be able to scan it latter.

EAN code already on the product packaging.

> [@pokoli](#):
>
> Sorry but I do not understand what do you understand. Could you please clarify?

Setup “Product Code” is not enough to define how to generate a barcode.

> [@pokoli](#):
>
> Probably just 4cms width.

Why this size?

> [@pokoli](#):
>
> Because users just need to pick the desired configuration and they will have a barcode with a sample format.

I do not see the point if it does not work for them.

> [@pokoli](#):
>
> From there they can just adjust the template to their needs.

So it is easier to make the right template directly.

> [@pokoli](#):
>
> Otherwise they won’t know which functions they need to call nor which fields to use (sometimes even they won’t know how to create the report).

For me this sounds like marketing strategy. Show a broken feature so users will ask to fix it.  
I do not like this way of developing. I prefer no solution than a broken one.

---

<div class="post-metadata">

**Author:** ![pokoli](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/pokoli/32/22_2.png) [@pokoli](https://discuss.tryton.org/u/pokoli)\
**Post date:** [July 20, 2023, 3:31pm UTC](https://discuss.tryton.org/t/allow-to-print-barcode-of-a-product/6359/5 "2023-07-20T15:31:17Z")

</div>

> [@ced](#):
>
> EAN code already on the product packaging.

Sorry but I do not not understand. What do you mean about product packaging?

> [@ced](#):
>
> Setup “Product Code” is not enough to define how to generate a barcode.

No you just need to setup which code to use and format.

> [@ced](#):
>
> Why this size?

Any better proposal?

> [@ced](#):
>
> > [@pokoli](#):
> >
> > Because users just need to pick the desired configuration and they will have a barcode with a sample format.
> 
> I do not see the point if it does not work for them.

Better to have an ERP to adapt than create a new one from scratch, no?

> [@ced](#):
>
> So it is easier to make the right template directly.

Then why we have standard templates for invoices/sales if they need to adapt them?

> [@ced](#):
>
> Show a broken feature so users will ask to fix it.  
> I do not like this way of developing. I prefer no solution than a broken one.

Why do you say its broken? I just want to have something flexible that may work on more case.  
Do you mean that are report templates are broken? Because we are adapting them for **every** instalation we do as they do not fix the user needs.

---

<div class="post-metadata">

**Author:** ![SISalp](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/sisalp/32/200_2.png) [@SISalp](https://discuss.tryton.org/u/SISalp)\
**Post date:** [July 21, 2023, 10:38am UTC](https://discuss.tryton.org/t/allow-to-print-barcode-of-a-product/6359/6 "2023-07-21T10:38:28Z")

</div>

> [@pokoli](#):
>
> Do you mean that are report templates are broken? Because we are adapting them for **every** instalation

I may mis-understand, but my point of view is that standard tryton features must be available out of the box, with no custom service.  
But I think it is not what you propose.

---

<div class="post-metadata">

**Author:** ![pokoli](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/pokoli/32/22_2.png) [@pokoli](https://discuss.tryton.org/u/pokoli)\
**Post date:** [July 21, 2023, 10:39am UTC](https://discuss.tryton.org/t/allow-to-print-barcode-of-a-product/6359/7 "2023-07-21T10:39:26Z")

</div>

> [@SISalp](#):
>
> but my point of view is that standard tryton features must be available out of the box, with no custom service.

Then I think we should agree that it will be good to have a report to print a barcode for a product?

---

<div class="post-metadata">

**Author:** ![SISalp](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/sisalp/32/200_2.png) [@SISalp](https://discuss.tryton.org/u/SISalp)\
**Post date:** [July 21, 2023, 12:28pm UTC](https://discuss.tryton.org/t/allow-to-print-barcode-of-a-product/6359/8 "2023-07-21T12:28:12Z")

</div>

> [@pokoli](#):
>
> Then I think we should agree

Still in my learning period. Reading this thread befor making my own opinion.  
My point was about standard Tryton installation with no service. A generic view-point, but probably not an answer to what you proposed.

---

<div class="post-metadata">

**Author:** ![udono](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/udono/32/2114_2.png) [@udono](https://discuss.tryton.org/u/udono)\
**Post date:** [July 24, 2023, 3:23pm UTC](https://discuss.tryton.org/t/allow-to-print-barcode-of-a-product/6359/9 "2023-07-24T15:23:29Z")

</div>

> [@pokoli](#):
>
> Then I think we should agree that it will be good to have a report to print a barcode for a product?

I like the idea of a general configuration for representing product barcodes. But IMHO an implementation based on `save _eval` which could allow all product fields could be more sufficient, as there are

> [@Allow to scan product barcodes on sale point](https://discuss.tryton.org/t/allow-to-scan-product-barcodes-on-sale-point/6351/3):
>
> barcode[s] which include the quantity[…]

Also as an additional functionality, _matching_ could be user definable, as

> [@Allow to scan product barcodes on sale point](https://discuss.tryton.org/t/allow-to-scan-product-barcodes-on-sale-point/6351/3):
>
> […] using barcode should be more strict than guessing with record name.

But I can’t see a good general implementation for a report for now. Your idea

> [@pokoli](#):
>
> have a libreoffice template which prints the product name and barcode.

reminds me too much of the _party label_ report. It was implemented for printing address labels for parties.  
But IMHO the using on special labelling paper with self-adhesive stickers (Avery, Zweckform,…) is very limited, because the vertical size of a label is variable and defined by the label text and a waste of resources, as a management for empty labels on a page is missing… Serial label printer with endless stickers are also not supported, as these printers usually work very different (ZPL2, ESC-P, …). So the party labels can be printed on plain paper, cut with scissors and glued manually… but for cutting there are crop marks missing and the result is limited in use… So we don’t use the party label report in any of our projects and deactivate it.

OTOH it would be excellent if Tryton supports the users, to use barcodes in their own custom Product/Party Label reports.  
For this it would be very helpful if Tryton provides a field or property with the bar code binary data.

---

<div class="post-metadata">

**Author:** ![pokoli](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/pokoli/32/22_2.png) [@pokoli](https://discuss.tryton.org/u/pokoli)\
**Post date:** [July 24, 2023, 3:33pm UTC](https://discuss.tryton.org/t/allow-to-print-barcode-of-a-product/6359/10 "2023-07-24T15:33:45Z")

</div>

> [@udono](#):
>
> For this it would be very helpful if Tryton provides a field or property with the bar code binary data

Indeed barcodes can be also generated and shown on forms using binary widgets.  
I always thought that is a good idea to show them on the user interface to let users aware that they can create a custom report for printing them.
