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

Attach Report While Printing

اشتراك

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

لقد تم الإبلاغ عن هذا السؤال
reportingattachmentsodoo10odoo10.0
1 الرد
12058 أدوات العرض
الصورة الرمزية
Sebin Siby

I have a report in account.invoice which have a wizard of model invoice.details.

While the report is printed I need to automatically attach the file to the attachment drop down of corresponding invoice.

How is this possible? Anyone have idea?

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

Hi,

For the reports  to save in the attachments button in the top of the form view, add a attachments in the report tag you have given for the report.

<report     
string="Request for Quotation"
id="report_purchase_quotation"
model="purchase.order"
report_type="qweb-pdf"
name="purchase.report_purchasequotation"
file="purchase.report_purchasequotation"
attachment="(object.name + '_test_report.pdf')"/>/>

Normally this will save the downloaded reports to  the attachments button, see Quotation /Order in sales.

For attachments button to visible in all view, install the module document(technical name)

Check whether it will work in your case.

This is a sample code for creating an attachment and it will show in attachment button in top of the form too

attachment_model = request.env['ir.attachment']
byte_str = kw['attachments[4]'].read()
uploaded_file = base64.encodestring(byte_str)
vals = {
'name': kw['attachments[4]'].filename,
'res_model': model_name,
'res_id': new_record.id,
'datas': uploaded_file}
attachments_record = attachment_model.sudo().create(vals)

Thanks

1
الصورة الرمزية
إهمال
Sebin Siby
الكاتب

I have tried this and didn't worked. I have to do it from the code

Niyas Raphy (Walnut Software Solutions)

just updated the answer, check it can help you or not

Sebin Siby
الكاتب

I have tried the code below. I get error showing 'my.model' object has no attribute 'custom_name'.

I am calling this function from print function in my wizard and my wizard have field 'custom_name'. Wizard is called from 'my.model' form view.

def attach_report(self):

attachment_obj = self.env['ir.attachment']

for record in self:

ir_actions_report = self.env['ir.actions.report.xml']

matching_reports = ir_actions_report.search([('report_name','=','module_name.report_template')])

if matching_reports:

report = matching_reports[0]

report_service = report.report_name

result, format = odoo_report.render_report(self._cr, self._uid, [record.id], report_service, {'model': self._name}, self._context)

eval_context = {'time': time, 'object': record}

if not report.attachment or not eval(report.attachment, eval_context):

# no auto-saving of report as attachment, need to do it manually

result = base64.b64encode(result)

file_name = re.sub(r'[^a-zA-Z0-9_-]', '_', "Report Name Here")

file_name += ".pdf"

attachment_id = attachment_obj.create({

'name': file_name,

'datas': result,

'datas_fname': file_name,

'res_model': 'my.model',

'res_id': self._context.get('active_id', False),

'type': 'binary'

})

return True

Sebin Siby
الكاتب

I know how to use this. But it is attaching to the model of wizard. I want it to attach to the corresponding record from which the report is called.

<report

string="Request for Quotation"

id="report_purchase_quotation"

model="purchase.order"

report_type="qweb-pdf"

name="purchase.report_purchasequotation"

file="purchase.report_purchasequotation"

attachment="(object.name + '_test_report.pdf')"/>/>

shalin wilson

how to attach a pdf file to a report?

i just want to add spec sheet of a product to the product report

هل أعجبك النقاش؟ لا تكن مستمعاً فقط. شاركنا!

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

تسجيل
المنشورات ذات الصلة الردود أدوات العرض النشاط
Attachment Issues Odoo 10 CE
attachments odoo10
الصورة الرمزية
0
يناير 19
3272
How to upload attachment in the bank statement line?
attachments odoo10.0
الصورة الرمزية
0
نوفمبر 18
3631
How to groups the same value report in QWEB Odoo تم الحل
reporting group_by qweb-report odoo10 odoo10.0
الصورة الرمزية
الصورة الرمزية
الصورة الرمزية
4
أغسطس 18
8910
Odoo10: Binary fields to file in ir.attachment
odoo10 odoo10.0
الصورة الرمزية
الصورة الرمزية
1
نوفمبر 17
10999
Version 10.0: localhost refused to connect تم الحل
odoo10 odoo10.0
الصورة الرمزية
الصورة الرمزية
الصورة الرمزية
الصورة الرمزية
6
ديسمبر 23
21074
المجتمع
  • دروس
  • التوثيق
  • المنتدى
مصدر مفتوح
  • تحميل
  • جيت هاب "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