Skip to Content
Menu
This question has been flagged
3 Replies
3637 Views

Hi,


Odoo: v17

View(menu path): Inventory / Products / Products 

a product form view:

Button: "Print Labels"

Then in print options window/form there is Format option:

Model: product.label.layout

Field: print_format


Where could I configure/set Format options?


I found these, but I am stuck on these as none seems to do what I want:


Menu: Settings / Technical / Reporting / Paper Format

Here I added new paper format needed for my label printer, but no changes on product label print options view.


Menu: Settings / Technical / Reporting / Reports

Here I can find Product labels, but then there is templates. I guess that this could be somehow connected. But if yes, then how?


brgds & looking forward



Avatar
Discard
Best Answer

Hi Janeks,

If your goal is to design your own product labels, you can achieve it by coding or with third-party apps.


By coding, you can create the own labels or modify the existing ones, that are placed in the "product" module by the path addons/product/report/product_product_templates.xml.

The standard Odoo label includes several elements:

  • specific paper format (samples are located by the path - addons/product/report/product_reports.xml)
  • action record of the "ir.actions.report" (samples are located by the path - addons/product/report/product_reports.xml)
  • label templates (samples are located by the path - addons/product/report/product_template_templates.xml and addons/product/report/product_product_templates.xml)

The practical approach, do not change the standard Odoo modules, you need to create your custom module and make all changes in it.


The third-party app to create product labels with your design without coding, that I can suggest, is Odoo Product Label Builder. This app allows you to create product labels with different size and place them as on a single label layout, as on multi-label layout (A4, US Letter sheets). It's distributed with the custom print wizard and the direct print feature to avoid downloading the PDF file before printing.

 

Best regards, Yurii Razumovskyi.

Company Garazd CreationOdoo solutions for e-Commerce, SEO, Data Feeds, Website Tracking, Marketing, Analytics, and Marketplace integrations, Product Label designing and printing.

https://garazd.biz  |  Our solutions on Odoo Apps

Avatar
Discard
Author Best Answer

Thanks for your answers!

I managed to find out one step further, but I still have unclear links, that I'll try to describe bellow:


Now I can find the Format options in the field (print_format) of product.label.layout as Selection options


Value​


Name​


dymo Dymo

2x7xprice 2 x 7 with price

4x7xprice 4 x 7 with price

4x12 4 x 12

4x12xprice 4 x 12 with price

zpl ZPL Labels

zplxprice ZPL Labels with price

Add a line


, but still unclear where exactly to put the (XML?) definitions of these values.


Do I really need custom module to define just an option for specific printer (custom) size printout?


brgds & looking forward:

Janeks

Avatar
Discard
Best Answer

Hi,

print_format is a selection field in the model product.label.layout. If you need to add a new format in an existing one.Try the below code.


Python:

class ProductLabelLayout(models.TransientModel):

    _inherit = 'product.label.layout'


    print_format = fields.Selection(selection_add=[

        ('new', 'New Labels'),

    ], ondelete={'new': 'set default'})


     def _prepare_report_data(self):

        xml_id, data = super()._prepare_report_data()

        if 'new' in self.print_format:

            xml_id = 'module_name.label_product_product'

        return xml_id,data

xml

<record id="label_product_product" model="ir.actions.report">

            <field name="name">Product Label (New)</field>

            <field name="model">product.product</field>

            <field name="report_type">qweb-text</field>

            <field name="report_name">module_name.label_product_product_view</field>

            <field name="report_file">module_name.label_product_product_view</field>

            <field name="binding_model_id" eval="False"/>

            <field name="binding_type">report</field>

</record>

<?xml version="1.0" encoding="UTF-8"?>

<odoo>

    <data>

        <template id="label_product_product_view">

           //Add you template

        </template>

     </data>

<odoo>


Hope it helps

Avatar
Discard
Related Posts Replies Views Activity
1
Apr 23
2264
0
Jun 25
7388
2
May 20
2594
0
Apr 19
4280
0
Mar 17
3111