تخطي للذهاب إلى المحتوى
أودو القائمة
  • تسجيل الدخول
  • جرب مجاناً
  • التطبيقات
    المالية
    • المحاسبة
    • فوترة
    • النفقات
    • جدول البيانات (BI)
    • المستندات
    • توقيع إلكتروني
    المبيعات
    • إدارة علاقات العملاء
    • المبيعات
    • نقطة البيع للمتاجر
    • نقطة البيع للمطاعم
    • الاشتراكات
    • تأجير
    المواقع الإلكترونية
    • أداة بناء المواقع الإلكترونية
    • متاجر إلكترونية
    • مدونة
    • المنتدى
    • دردشة مباشرة
    • التعليم الإلكتروني
    سلسلة التوريد
    • المستودعات
    • التصنيع
    • إدارة دورة حياة المنتج
    • المشتريات
    • الصيانة
    • الجودة
    الموارد البشرية
    • موظفون
    • التوظيف
    • إجازة عمل
    • التقييمات
    • الإحالات
    • تطبيق الأسطول
    التسويق
    • التسويق الإجتماعي
    • التسويق عبر البريد الإلكتروني
    • التسويق عبر الرسائل النصية
    • فعاليات
    • أتمتة التسويق
    • الاستطلاعات
    الخدمات
    • المشاريع
    • الجداول الزمنية
    • الخدمة الميدانية
    • مكتب المساعدة
    • التخطيط
    • مواعيد
    اﻹنتاجية
    • مناقشة
    • الموافقات
    • إنترنت الأشياء "IoT"
    • بروتوكول ربط المحادثات الصوتية عبر الإنترنت
    • المعرفة
    • WhatsApp
    التطبيقات الخارجية ستوديو أودو منصة أودو السحابية
  • قطاعات الأعمال
    البيع بالتجزئة
    • متجر كتب
    • متجر ملابس
    • متجر أثاث
    • متجر بقالة
    • متجر معدات
    • متجر ألعاب
    الطعام والضيافة
    • بار وحانة
    • المطعم
    • مطعم للوجبات السريعة
    • نزل للضيوف
    • موزّع مشروبات
    • فندق
    العقارات
    • وكالة عقارات
    • شركة هندسة معمارية
    • البناء
    • إدارة العقارات
    • العناية بالحدائق
    • اتحاد مُلاّك العقارات
    استشارة
    • مؤسسة محاسبية
    • شريك أودو
    • وكالة تسويقية
    • منشأة قانونية
    • استقطاب المواهب
    • التدقيق والتوثيق
    التصنيع
    • الأقمشة
    • معدني
    • الأثاث
    • الطعام
    • مصنع خمور
    • هدايا الشركات
    الصحة واللياقة البدنية
    • نادي رياضي
    • متجر نظارات
    • مركز لياقة بدنية
    • الممارسون الصحيون
    • صيدلية
    • صالون تصفيف الشعر
    التجارة
    • عامل صيانة
    • الأجهزة والمعدات التقنية ودعمها
    • أنظمة الطاقة الشمسية
    • صانع أحذية
    • خدمات التنظيف
    • خدمات التكييف (HVAC)
    غير ذلك
    • منظمة غير ربحية
    • وكالة بيئية
    • تأجير لوحات إعلانية
    • تصوير
    • تأجير دراجات
    • بائع وسيط للبرمجيات
    تصفح كافة قطاعات الأعمال
  • مجتمع أودو
    تعلم
    • دروس
    • التوثيق
    • شهادات
    • التدريب
    • مدونة
    • بودكاست
    قم بتعزيز التعليم
    • برنامج تعليم
    • Scale UP! لعبة الأعمال
    • قم بزيارة أودو
    احصل على البرنامج
    • تحميل
    • قارنْ الإصدارات
    • إطلاق
    تعاون
    • جيت هاب "Github"
    • المنتدى
    • فعاليات
    • الترجمات
    • كنْ شريكاً
    • خدمات الشركاء
    • سجل مكتب المحاسبة الخاص بك
    احصل على الخدمات
    • اعثر على شريك
    • اعثر على محاسب
    • قابل أحد مرشدي الأعمال
    • خدمات التنفيذ
    • مراجع العملاء
    • الدعم
    • الترقيات
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    الحصول على عرض توضيحي
  • الأسعار
  • المساعدة

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

  • إدارة علاقات العملاء
  • e-Commerce
  • المحاسبة
  • المخزون
  • PoS
  • المشروع
  • MRP
All apps
يجب أن تكون مسجلاً حتى تتفاعل مع المجتمع.
كافة المنشورات الأفراد الشارات
علامات التصنيف (عرض الكل)
odoo accounting v14 pos v15
حول هذا المنتدى
يجب أن تكون مسجلاً حتى تتفاعل مع المجتمع.
كافة المنشورات الأفراد الشارات
علامات التصنيف (عرض الكل)
odoo accounting v14 pos v15
حول هذا المنتدى
المساعدة

Additional label formats

اشتراك

تسلم الإشعارات عندما يكون هناك نشاط في هذا المنشور

لقد تم الإبلاغ عن هذا السؤال
reportinglabelsv15
1 الرد
6288 أدوات العرض
الصورة الرمزية
Eauzon

I was trying to add aditional label formats using this module code:


from collections import defaultdict
from odoo import fields, models


class ProductLabelLayout(models.TransientModel):
_inherit = 'product.label.layout'

print_format = fields.Selection(selection_add=[
('2x4', '2 x 4')
], ondelete={'2x4': 'set default'})


And i thought that would do it, but it leads to an error. Any ideas ?


load could not load template
ValueError: Invalid template id: ''
Template: product.report_productlabel


0
الصورة الرمزية
إهمال
الصورة الرمزية
Cybrosys Techno Solutions Pvt.Ltd
أفضل إجابة

You need to try this code.When we create new selection field on the prin_format you must add new functions for that types and need to create new printing format

from collections import defaultdict
from odoo import fields, models,
_
from odoo.exceptions import UserError


class ProductLabelLayout(models.TransientModel):
_inherit =
'product.label.layout'

print_format = fields.Selection(selection_add=[
    (
'price_card', 'Price Card'), ], ondelete={'price_card': 'set default'})

def _prepare_report_data(self):
    xml_id, data =
super()._prepare_report_data()

   
if 'price_card' in self.print_format:
        xml_id =
module_name.report_product_label_product_price_tag'

        active_model =
''
       
if self.product_tmpl_ids:
            products =
self.product_tmpl_ids.ids
            active_model =
'product.template'
        elif
self.product_ids:
            products =
self.product_ids.ids
            active_model =
'product.product'
        price = format(
self.product_tmpl_ids.list_price, ".2f")
        data = {
           
'active_model': active_model,
           
'product_tmpl_name': self.product_tmpl_ids.name,
           
'product_tmpl_price': price,
           
'product_tmpl': self.product_tmpl_ids,
           
'product_name': self.product_ids.name,
           
'product_id': self.product_ids,
        }
   
return xml_id, data

def process(self):
    action =
super(ProductLabelLayout, self).process()
   
self.ensure_one()
    xml_id, data =
self._prepare_report_data()
   
if not xml_id:
        raise UserError(
_('Unable to find report template for %s format', self.print_format))
    report_action =
self.env.ref(xml_id).report_action(None, data=data)
    report_action.update({
'close_on_report_download': True})
   
return action

Also, try to add the paper format and further details

<record id="paperformat_product_price_tag" model="report.paperformat">
    <field name="name">Price Card Label</field>
    <field name="default" eval="True"/>
    <field name="format">custom</field>
    <field name="page_height">267</field>
    <field name="page_width">175</field>
    <field name="orientation">Landscape</field>
    <field name="margin_top">0</field>
    <field name="margin_bottom">0</field>
    <field name="margin_left">0</field>
    <field name="margin_right">0</field>
    <field name="disable_shrinking" eval="True"/>
    <field name="header_line" eval="False"/>
    <field name="header_spacing">0</field>
    <field name="dpi">96</field>
</record>
<record id="report_product_label_product_price_tag" model="ir.actions.report">
 
  <field name="name">Product Price Card</field>
    <field name="model">product.template</field>
    <field name="report_type">qweb-pdf</field>
    <field name="report_name">module_name.report_product_price_tag</field>
    <field name="report_file">module_name.report_product_price_tag</field>
    <field name="binding_type">report</field>
    <field name="binding_model_id" ref="model_product_template"/>
    <field name="paperformat_id" ref="paperformat_product_price_tag"/>
</record>
<template id="report_product_price_tag">
    //content
</template>




Hope it helps

1
الصورة الرمزية
إهمال
هل أعجبك النقاش؟ لا تكن مستمعاً فقط. شاركنا!

أنشئ حساباً اليوم لتستمتع بالخصائص الحصرية، وتفاعل مع مجتمعنا الرائع!

تسجيل
المنشورات ذات الصلة الردود أدوات العرض النشاط
ODOO 15 for "Einnahmenüberschussrechnung EÜR"
reporting v15
الصورة الرمزية
الصورة الرمزية
الصورة الرمزية
2
أغسطس 25
4085
report layout generates error on pdf export but works in preview
reporting v15
الصورة الرمزية
الصورة الرمزية
1
أبريل 25
5514
Reports: table headers repeating PO vs SO تم الحل
reporting v15
الصورة الرمزية
الصورة الرمزية
2
يوليو 24
7091
Insert image into a report تم الحل
reporting v15
الصورة الرمزية
الصورة الرمزية
1
أبريل 24
2860
V15 - Multiple IoT boxes with label printers
labels iot v15
الصورة الرمزية
الصورة الرمزية
الصورة الرمزية
الصورة الرمزية
3
مايو 24
3372
المجتمع
  • دروس
  • التوثيق
  • المنتدى
مصدر مفتوح
  • تحميل
  • جيت هاب "Github"
  • المشغل الآلي رنبوت
  • الترجمات
خدماتنا
  • استضافة أودو إس إتش
  • الدعم
  • الترقية
  • التطويرات المخصصة
  • التعليم
  • اعثر على محاسب
  • اعثر على شريك
  • كنْ شريكاً
معلومات عنا
  • شركتنا
  • أصول العلامة التجارية
  • اتصلْ بنا
  • الوظائف
  • فعاليات
  • بودكاست
  • مدونة
  • عملاء
  • قانوني • الخصوصية
  • الحماية
الْعَرَبيّة 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

أودو هو عبارة عن مجموعة من تطبيقات الأعمال مفتوحة المصدر التي تغطي جميع احتياجات شركتك، مثل: إدارة علاقات العملاء والتجارة الإلكترونية والمحاسبة والمخزون ونقاط البيع وإدارة المشاريع وما إلى ذلك.

ما يجعل من أودو مميزاً هو هدفه بأن يكون سهل الاستخدام للغاية ومتكاملاً تمامًا في الوقت ذاته.

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