تخطي للذهاب إلى المحتوى
أودو القائمة
  • تسجيل الدخول
  • جرب مجاناً
  • التطبيقات
    المالية
    • المحاسبة
    • فوترة
    • النفقات
    • جدول البيانات (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
حول هذا المنتدى
المساعدة

Error when trying to print custom report (Ver 12)

اشتراك

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

لقد تم الإبلاغ عن هذا السؤال
2 الردود
6327 أدوات العرض
الصورة الرمزية
Steven Deweirt

So I wrote a custom module that defines a custom report:

<odoo>
<report
id="report_product_test_zebra"
string="Product zebra test"
model="product.template"
report_type="qweb-pdf"
name="test_wizard.report_product_test_zebra"
file="report_producttestzebra"
print_report_name="TestZebra print"
/>
</odoo>

<odoo>

<template id="report_producttestzebra">

<t t-foreach="docs" t-as="template">

<t t-foreach="template.product_variant_ids" t-as="product">
<div class="page" style="page-break-after: always; margin-left:4px">
<div style="text-align: center">
<strong style="font-size:14px;" t-field="product.name"/>

<t t-if="product.barcode">

<img alt="Barcode" t-att-src="'/report/barcode/?type=%s&amp;value=%s&amp;width=%s&amp;height=%s' % ('Code128', product.barcode, 700, 200)" style="width:100%;height:20mm;"/>

<span style="font-size: 14px;" t-field="product.barcode"/>

</t>
</div>
        </div>
</t>
</t>
</template>
</odoo>

Then I defined a model for a wizard:

class PrintMultipleWizard(models.TransientModel):
_name = 'print.multiple_wizard'
_description: 'Multiple labels'

prod_ids = fields.Many2many('product.template', string='products')
#aantal = fields.Int(help="aantal dat moet afgedrukt worden")

@api.model
def default_get(self, field_names):
defaults = super(PrintMultipleWizard, self).default_get(field_names)
defaults['prod_ids'] = self.env.context['active_ids']
prod_ids = self.env.context.get('active_ids', [])
return defaults

@api.multi
def do_mass_print(self):
self.ensure_one()
actieve_ids = self._context.get('active_ids')
products_to_print = self.env['product.template'].browse(actieve_ids)

datas = {'ids': self.env.context.get('active_ids', [])}
res = self.read(['prod_ids'])

datas['form'] = res
return self.env.ref('test_wizard.report_product_test_zebra').report_action([], data=datas)

I also defined the wizard itself:

<odoo>
<record id="TestPrintModel" model="ir.ui.view">
<field name="name">Test print aantal labels</field>
<field name="model">print.multiple_wizard</field>
<field name="arch" type="xml">

<form>
<field name="prod_ids">
<tree>
<field name="name"/>
</tree>
</field>

<footer>
<button type="object" name="do_mass_print"
string="Do it" class="oe_highlight"
/>
<button special="cancel" string="Cancel"/>
</footer>

</form>

</field>
</record>

<!--More button Action-->
<act_window id="action_test_print_multiple"
name="print multiple labels"
src_model="product.template"
res_model="print.multiple_wizard"
view_mode="form"
target="new"
multi="True"
/>
</odoo>

Now, after I press the button to print, I get the following error:

Odoo Server Error
Traceback (most recent call last):
  File "/opt/odoo/odoo/odoo/addons/base/models/qweb.py", line 346, in _compiled_fn
    return compiled(self, append, new, options, log)
  File "<template>", line 1, in template_portal_frontend_layout_302
  File "<template>", line 2, in body_call_content_301
AttributeError: 'NoneType' object has no attribute 'id'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/odoo/odoo/addons/web/controllers/main.py", line 1675, in report_download
    response = self.report_routes(reportname, converter=converter, **dict(data))
  File "/opt/odoo/odoo/odoo/http.py", line 517, in response_wrap
    response = f(*args, **kw)
  File "/opt/odoo/odoo/addons/web/controllers/main.py", line 1612, in report_routes
    pdf = report.with_context(context).render_qweb_pdf(docids, data=data)[0]
  File "/opt/odoo/odoo/custom_addons/base_report_to_printer/models/ir_actions_report.py", line 146, in render_qweb_pdf
    res_ids=res_ids, data=data)
  File "/opt/odoo/odoo/odoo/addons/base/models/ir_actions_report.py", line 682, in render_qweb_pdf
    html = self.with_context(context).render_qweb_html(res_ids, data=data)[0]
  File "/opt/odoo/odoo/enterprise/web_studio/models/ir_actions_report.py", line 15, in render_qweb_html
    return super(IrActionsReport, self).render_qweb_html(docids, data)
  File "/opt/odoo/odoo/odoo/addons/base/models/ir_actions_report.py", line 722, in render_qweb_html
    return self.render_template(self.report_name, data), 'html'
  File "/opt/odoo/odoo/odoo/addons/base/models/ir_actions_report.py", line 505, in render_template
    return view_obj.render_template(template, values)
  File "/opt/odoo/odoo/odoo/addons/base/models/ir_ui_view.py", line 1284, in render_template
    return self.browse(self.get_view_id(template)).render(values, engine)
  File "/opt/odoo/odoo/addons/website/models/ir_ui_view.py", line 318, in render
    return super(View, self).render(values, engine=engine, minimal_qcontext=minimal_qcontext)
  File "/opt/odoo/odoo/addons/web_editor/models/ir_ui_view.py", line 27, in render
    return super(IrUiView, self).render(values=values, engine=engine, minimal_qcontext=minimal_qcontext)
  File "/opt/odoo/odoo/odoo/addons/base/models/ir_ui_view.py", line 1293, in render
    return self.env[engine].render(self.id, qcontext)
  File "/opt/odoo/odoo/enterprise/web_studio/models/ir_qweb.py", line 43, in render
    return super(IrQWeb, self).render(template, values=values, **options)
  File "/opt/odoo/odoo/odoo/addons/base/models/ir_qweb.py", line 59, in render
    result = super(IrQWeb, self).render(id_or_xml_id, values=values, **context)
  File "/opt/odoo/odoo/odoo/addons/base/models/qweb.py", line 274, in render
    self.compile(template, options)(self, body.append, values or {})
  File "/opt/odoo/odoo/odoo/addons/base/models/qweb.py", line 348, in _compiled_fn
    raise e
  File "/opt/odoo/odoo/odoo/addons/base/models/qweb.py", line 346, in _compiled_fn
    return compiled(self, append, new, options, log)
  File "<template>", line 1, in template_772_254
  File "/opt/odoo/odoo/odoo/addons/base/models/qweb.py", line 353, in _compiled_fn
    raise QWebException("Error to render compiling AST", e, path, node and etree.tostring(node[0], encoding='unicode'), name)
odoo.addons.base.models.qweb.QWebException: 'NoneType' object has no attribute 'id'
Traceback (most recent call last):
  File "/opt/odoo/odoo/odoo/addons/base/models/qweb.py", line 346, in _compiled_fn
    return compiled(self, append, new, options, log)
  File "<template>", line 1, in template_portal_frontend_layout_302
  File "<template>", line 2, in body_call_content_301
AttributeError: 'NoneType' object has no attribute 'id'

Error to render compiling AST
AttributeError: 'NoneType' object has no attribute 'id'
Template: portal.frontend_layout
Path: /templates/t/t/t[4]
Node: <t t-set="x_icon" t-value="'/web/image/website/%s/favicon/' % website.id"/>
    

Anybody have any idea what exactly is going wrong here? Thanks in advance!

0
الصورة الرمزية
إهمال
الصورة الرمزية
Niyas Raphy (Walnut Software Solutions)
أفضل إجابة

Hi,

From the error message it says that the variable named website is not record set, might be it is not receiving value in it.


Check and ensure that the website variable contain values.


Thanks

0
الصورة الرمزية
إهمال
الصورة الرمزية
Alberto Rubio
أفضل إجابة

Obviously, website variable is not receiving any value in it.
Did you find any solution on that? Im on that mess aswell.
I will apreciate any answer.

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

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

تسجيل
المجتمع
  • دروس
  • التوثيق
  • المنتدى
مصدر مفتوح
  • تحميل
  • جيت هاب "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