Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
5 Odpowiedzi
5220 Widoki

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



Awatar
Odrzuć
Najlepsza odpowiedź

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

Awatar
Odrzuć
Najlepsza odpowiedź

Hello Janeks,



Configuring label formats in Odoo can indeed be a bit tricky at first. Here's a step-by-step guide to help you set up your product label formats correctly:



  First, ensure your custom paper format is correctly created under Settings / Technical / Reporting / Paper Formats. This step is crucial for defining the physical dimensions of your labels.

  Next, navigate to Settings / Technical / Reporting / Reports. Locate the 'Product Labels' report and click on it to edit. Here, you can associate your report with the newly created paper format.

  If you need to customize the layout further, you might need to edit the QWeb template associated with the product labels. This can be found in the same Reports section under the 'Product Labels' report. Look for the 'QWeb View' field to edit the HTML and CSS.


Remember, changes in report templates and formats may require technical knowledge of QWeb templating language. If you're not comfortable making these changes, consider reaching out to a professional for assistance.


For personalized assistance:
https://www.pragtech.co.in/contact-us-mql.html

Awatar
Odrzuć
Najlepsza odpowiedź

These are still to hard, so tired of having to hire someone i'm tired of odoo.  Just want labels, just need that and all you  want someone to do is pay money to use your site.  sick of it.

Awatar
Odrzuć
Autor Najlepsza odpowiedź

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

Awatar
Odrzuć
Najlepsza odpowiedź

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

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
1
kwi 23
2553
0
cze 25
7838
2
maj 20
2823
0
kwi 19
4577
0
mar 17
3459