Skip to Content
Odoo Menu
  • Zaloguj się
  • Wypróbuj za darmo
  • Aplikacje
    Finanse
    • Księgowość
    • Fakturowanie
    • Wydatki
    • Arkusz kalkulacyjny (BI)
    • Dokumenty
    • Podpisy
    Sprzedaż
    • CRM
    • Sprzedaż
    • PoS Sklep
    • PoS Restauracja
    • Subskrypcje
    • Wypożyczalnia
    Strony Internetowe
    • Kreator Stron Internetowych
    • eCommerce
    • Blog
    • Forum
    • Czat na Żywo
    • eLearning
    Łańcuch dostaw
    • Magazyn
    • Produkcja
    • PLM
    • Zakupy
    • Konserwacja
    • Jakość
    Zasoby Ludzkie
    • Pracownicy
    • Rekrutacja
    • Urlopy
    • Ocena pracy
    • Polecenia Pracownicze
    • Flota
    Marketing
    • Marketing Społecznościowy
    • E-mail Marketing
    • SMS Marketing
    • Wydarzenia
    • Automatyzacja Marketingu
    • Ankiety
    Usługi
    • Projekt
    • Ewidencja czasu pracy
    • Usługi Terenowe
    • Helpdesk
    • Planowanie
    • Spotkania
    Produktywność
    • Dyskusje
    • Zatwierdzenia
    • IoT
    • VoIP
    • Baza wiedzy
    • WhatsApp
    Aplikacje trzecich stron Studio Odoo Odoo Cloud Platform
  • Branże
    Sprzedaż detaliczna
    • Księgarnia
    • Sklep odzieżowy
    • Sklep meblowy
    • Sklep spożywczy
    • Sklep z narzędziami
    • Sklep z zabawkami
    Żywienie i hotelarstwo
    • Bar i Pub
    • Restauracja
    • Fast Food
    • Pensjonat
    • Dystrybutor napojów
    • Hotel
    Agencja nieruchomości
    • Agencja nieruchomości
    • Biuro architektoniczne
    • Budowa
    • Zarządzanie nieruchomościami
    • Ogrodnictwo
    • Stowarzyszenie właścicieli nieruchomości
    Doradztwo
    • Biuro księgowe
    • Partner Odoo
    • Agencja marketingowa
    • Kancelaria prawna
    • Agencja rekrutacyjna
    • Audyt i certyfikacja
    Produkcja
    • Tekstylia
    • Metal
    • Meble
    • Jedzenie
    • Browar
    • Prezenty firmowe
    Zdrowie & Fitness
    • Klub sportowy
    • Salon optyczny
    • Centrum fitness
    • Praktycy Wellness
    • Apteka
    • Salon fryzjerski
    Transakcje
    • Złota rączka
    • Wsparcie Sprzętu IT
    • Systemy energii słonecznej
    • Szewc
    • Firma sprzątająca
    • Usługi HVAC
    Inne
    • Organizacja non-profit
    • Agencja Środowiskowa
    • Wynajem billboardów
    • Fotografia
    • Leasing rowerów
    • Sprzedawca oprogramowania
    Przeglądaj wszystkie branże
  • Community
    Ucz się
    • Samouczki
    • Dokumentacja
    • Certyfikacje
    • Szkolenie
    • Blog
    • Podcast
    Pomóż w nauce innym
    • Program Edukacyjny
    • Scale Up! Gra biznesowa
    • Odwiedź Odoo
    Skorzystaj z oprogramowania
    • Pobierz
    • Porównaj edycje
    • Wydania
    Współpracuj
    • Github
    • Forum
    • Wydarzenia
    • Tłumaczenia
    • Zostań partnerem
    • Usługi dla partnerów
    • Zarejestruj swoją firmę rachunkową
    Skorzystaj z usług
    • Znajdź partnera
    • Znajdź księgowego
    • Spotkaj się z doradcą
    • Usługi wdrożenia
    • Opinie klientów
    • Wsparcie
    • Aktualizacje
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Zaplanuj demo
  • Cennik
  • Pomoc

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Księgowość
  • Zapasy
  • PoS
  • Projekt
  • MRP
All apps
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
Wszystkie posty Osoby Odznaki
Tagi (Zobacz wszystko)
odoo accounting v14 pos v15
O tym forum
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
Wszystkie posty Osoby Odznaki
Tagi (Zobacz wszystko)
odoo accounting v14 pos v15
O tym forum
Pomoc

How can I change the print labels in products <- inventory to include print barcode labels formatted for 38.1 mm × 21.2 mm (65 labels per A4 sheet, like Avery L7159/ST-65) from inside Odoo. Using the one App free community version.

Zaprenumeruj

Otrzymaj powiadomienie o aktywności w tym poście

To pytanie dostało ostrzeżenie
configurationdebug
2 Odpowiedzi
238 Widoki
Awatar
Abhas Maskey

Hello I am using the  Odoo Version 19.0 Community Edition. I want to print a 13x5 product label  directly as a PDF like any other from the print labels.  I went into Developer Mode  to change things and I duplicated the default product label report and customized it for the 13x5 label format.

I’ve named the report Product Label 13x5 (PDF) and set the Model to product.template with the corresponding template (product.report_producttemplatelabel13x5). Even though the external ID exists in Settings → Technical → Database Structure → External Identifiers, Odoo is not recognizing it when I try to use it in the form view button.

Traceback (most recent call last):
  File "/home/odoo/src/odoo/19.0/odoo/tools/safe_eval.py", line 397, in safe_eval
    return unsafe_eval(c, globals_dict, None)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "ir.actions.server(331,)", line 2, in <module>
  File "/home/odoo/src/odoo/19.0/odoo/orm/models.py", line 6159, in mapped
    field = records._fields[field_name]
            ~~~~~~~~~~~~~~~^^^^^^^^^^^^
KeyError: 'product_tmpl_id'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/odoo/src/odoo/19.0/odoo/http.py", line 2266, in _serve_db
    return service_model.retrying(serve_func, env=self.env)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/odoo/src/odoo/19.0/odoo/service/model.py", line 184, in retrying
    result = func()
             ^^^^^^
  File "/home/odoo/src/odoo/19.0/odoo/http.py", line 2313, in _serve_ir_http
    response = self.dispatcher.dispatch(rule.endpoint, args)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/odoo/src/odoo/19.0/odoo/http.py", line 2528, in dispatch
    result = self.request.registry['ir.http']._dispatch(endpoint)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/odoo/src/odoo/19.0/odoo/addons/base/models/ir_http.py", line 357, in _dispatch
    result = endpoint(**request.params)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/odoo/src/odoo/19.0/odoo/http.py", line 788, in route_wrapper
    result = endpoint(self, *args, **params_ok)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/odoo/src/odoo/19.0/addons/web/controllers/action.py", line 58, in run
    result = action.run()
             ^^^^^^^^^^^^
  File "/home/odoo/src/odoo/19.0/odoo/addons/base/models/ir_actions.py", line 1177, in run
    res = action._run(records, eval_context)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/odoo/src/odoo/19.0/odoo/addons/base/models/ir_actions.py", line 1190, in _run
    res = runner(run_self, eval_context=eval_context)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/odoo/src/odoo/19.0/odoo/addons/base/models/ir_actions.py", line 1014, in _run_action_code_multi
    safe_eval(self.code.strip(), eval_context, mode="exec", filename=str(self))
  File "/home/odoo/src/odoo/19.0/odoo/tools/safe_eval.py", line 403, in safe_eval
    raise ValueError('%r while evaluating\n%r' % (e, expr))
ValueError: KeyError('product_tmpl_id') while evaluating
"if records:\r\n    templates = records.mapped('product_tmpl_id')  # map product variants to templates\r\n    templates.env.ref('custom.report_product_label_13x5').report_action(templates)"

The above server error caused the following client error:
RPC_ERROR: Odoo Server Error
    RPC_ERROR
       

How to properly link the button to the report in the form view?

0
Awatar
Odrzuć
Codesphere Tech

Hello,
Can you tell me what you get in"records"? because error shows that records does not have a product_tmpl_id field.

Awatar
Cybrosys Techno Solutions Pvt.Ltd
Najlepsza odpowiedź

Hi,


The error occurs because your duplicated product label report is linked to the product.template model, while the default server action expects the product.product model. The standard print logic calls records.mapped('product_tmpl_id'), which exists only on product variants, not on templates, hence the KeyError.


To fix this, you have two options. The simplest is to change your report’s model back to product.product, matching Odoo’s default behavior. This allows the existing button code to work without modification and automatically prints labels for the corresponding product templates. Alternatively, if you prefer to keep the report on product.template, you must edit the server action code to remove the mapping and directly call report_action(records) instead.


Finally, make sure your report’s external ID matches the one defined in its XML configuration, and that your custom print button correctly references the related server action. In general, keeping the report model as product.product is the most compatible approach since it aligns with Odoo’s standard label printing workflow and reduces future maintenance issues.


Hope it helps

0
Awatar
Odrzuć
Awatar
Abhas Maskey
Autor Najlepsza odpowiedź

 In reports- 

Model Name  : product.template

Template Name :product.report_producttemplatelabel13x5

Printed Report Name? 'Products Labels - %s' % (object.name)


0
Awatar
Odrzuć
Codesphere Tech

I mean to ask that records are pointing to which model?

Codesphere Tech

If records is belong to product.template model then you can not access this field from its own model.. you need records of product.product. hope this helps.

Podoba Ci się ta dyskusja? Dołącz do niej!

Stwórz konto dzisiaj, aby cieszyć się ekskluzywnymi funkcjami i wchodzić w interakcje z naszą wspaniałą społecznością!

Zarejestruj się
Powiązane posty Odpowiedzi Widoki Czynność
Odoo18 community crashes after more than a week of running smoothly
configuration debug
Awatar
Awatar
1
sie 25
1547
Customizing "Search More" in Odoo Studio (Editing views)
configuration debug
Awatar
0
sie 25
985
Setup script for on-premise Odoo
configuration debug
Awatar
0
cze 25
1315
How to fix canonical links Rozwiązane
configuration debug
Awatar
Awatar
1
cze 25
2198
[Aide] Modules custom non détectés ou non exécutés sur Odoo 18 (Windows)
development configuration debug
Awatar
Awatar
1
paź 25
778
Społeczność
  • Samouczki
  • Dokumentacja
  • Forum
Open Source
  • Pobierz
  • Github
  • Runbot
  • Tłumaczenia
Usługi
  • Hosting Odoo.sh
  • Wsparcie
  • Aktualizacja
  • Indywidualne rozwiązania
  • Edukacja
  • Znajdź księgowego
  • Znajdź partnera
  • Zostań partnerem
O nas
  • Nasza firma
  • Zasoby marki
  • Skontaktuj się z nami
  • Oferty pracy
  • Wydarzenia
  • Podcast
  • Blog
  • Klienci
  • Informacje prawne • Prywatność
  • Bezpieczeństwo Odoo
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo to pakiet aplikacji biznesowych typu open source, które zaspokoją wszystkie potrzeby Twojej firmy: CRM, eCommerce, księgowość, inwentaryzacja, punkt sprzedaży, zarządzanie projektami itp.

Unikalną wartością Odoo jest to, że jest jednocześnie bardzo łatwe w użyciu i w pełni zintegrowane.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now