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

Get the value of one2many field in excel report

اشتراك

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

لقد تم الإبلاغ عن هذا السؤال
one2manyreportinginvoicingOdoo13.0
2 الردود
5499 أدوات العرض
الصورة الرمزية
Suhaib Ahmed Khateeb

I have created a custom report for invoice summary, i can easily fetch the header part of the invoice line invoice date, partner name etc.. But when it comes to invoice lines I am unable to fetch the data.

Please check this code out

for invoice in invoice_objs:
invoice_date = invoice.invoice_date.strftime('%Y-%m-%d') /correct
worksheet.write(row, 0, invoice_date) /correct
worksheet.write(row, 1, invoice.name) /correct
worksheet.write(row, 2, invoice.partner_id.name)
for product_id in account.move.line:
worksheet.write(row, 3, invoice_line_ids.product_id.name)


I am getting error in the last 3 lines of the code

can anyone suggest how to fetch data from a one2many field in odoo13

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

Hi Suhaib, 

For your question, did you try: 

worksheet.write(row, 3,  ', '.join(invoice.invoice_line_ids.mapped('product_id.name'))

of course, you don't need iteration on products when you use this code.

P.S: 
I think you code is incorrect: Because your second iteration will erase the first inserted data. ( you're always pointing at row, unless, hopefully, you tell me row is incremted and not shown here ^^ ) 



------------- UPDATE ---------------
Since you want to put each product in each line in case you have multiple products in sale order, please consider the following: 

In Odoo, you can export a sale order with Order lines/product Column and you can check the result in generated Xls. You will notice that in this case, odoo creates a new empty line and only adds name of article => This is how we import O2M fields in odoo. 

if len(invoice.invoice_line_ids) > 1:
    worksheet.write(row,3, invoice.invoice_line_ids[0].product_id.name)
for product_id in invoice.invoice_line_ids[1:]:
    row +=1
    worksheet.write(row, 3, product_id.name)

------------- END of UPDATE ---------------
Hope this helps. 
You can write me back if not for further analysis.

Regads.

0
الصورة الرمزية
إهمال
Suhaib Ahmed Khateeb
الكاتب

Yes Ibrahim row is incremented I used row+=1

Suhaib Ahmed Khateeb
الكاتب

Thanks Ibrahim it worked but partially, the products showing are in same line like you can see the second line under invoice description "betrillix,sample" those are two different products but showing in same line, how can I do them in two different lines?

Invoice Date Invoice Number Customer Invoice Description
2022-01-17 INV/2022/0001 Administrator Betrillix
2022-01-05 INV/2022/0003 My Company Betrillix, Sample
2022-01-03 INV/2022/0002 Administrator Betrillix

Ibrahim Boudmir

Well, i thought you wanted to add them in one cell.
So, what you need actually is the standard export of a O2M field based on product name only.
I ll update my answer.

Suhaib Ahmed Khateeb
الكاتب

Thanks Ibrahim but its coming like this
Invoice Date Invoice Number Customer Invoice Description
2022-01-17 INV/2022/0001 Administrator
2022-01-05 INV/2022/0003 My Company Betrillix
Sample
2022-01-03 INV/2022/0004 My Company
2022-01-03 INV/2022/0002 Administrator

Only the line with multiple products are visible not the single ones

Ibrahim Boudmir

i can't imagine the result of code. I need to see python code and excel file. if you send me these at my email, i probably can help better:
ibrahim.boudmir@gmail.com

Suhaib Ahmed Khateeb
الكاتب

Have mailed you
Thanks

Ibrahim Boudmir

if Ok for you, you can check my answer as the right answer.
Thanks

Suhaib Ahmed Khateeb
Done

On Mon, 24 Jan 2022, 10:30 pm Ibrahim Boudmir, <ibrahim.boudmir@gmail.com> wrote:

if Ok for you, you can check my answer as the right answer.
Thanks

Envoyé par Odoo S.A. utilisant Odoo.

الصورة الرمزية
Rahiya Basheer
أفضل إجابة

i have the same issues

def generate_xlsx_report(self, workbook, data, partners):
bold = workbook.add_format({'bold': True, 'align': 'center'})
format_1 = workbook.add_format({'bold': True, 'align': 'center', 'bg_color': 'cyan'})

for obj in partners:
sheet = workbook.add_worksheet(obj.customer_id.name)
row = 3
col = 3
sheet.set_column('D:D', 12)
sheet.set_column('E:E', 22)
row += 1
sheet.merge_range(row, col, row, col+1, 'Product Details', format_1)
row += 1
sheet.write(row, col, 'Customer', bold)
sheet.write(row, col+1, obj.customer_id.name)
row += 1
sheet.write(row, col, 'Vendor', bold)
sheet.write(row, col + 1, obj.vendor_id.name)
row += 1
sheet.write(row, col, 'Product', bold)
sheet.write(row, col+1, ', '.join(obj.products_ids.mapped('name.name')))
row += 1

i used the second last line to print the products. but actually that is not what i am expected. i need to print it like a table.


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

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

تسجيل
المنشورات ذات الصلة الردود أدوات العرض النشاط
Compute field in excel report تم الحل
reporting invoicing Odoo13.0
الصورة الرمزية
الصورة الرمزية
الصورة الرمزية
2
يناير 22
3007
Addition of two fields in excel report
reporting invoicing Odoo13.0
الصورة الرمزية
0
يناير 22
18
If Condition in excel report تم الحل
reporting invoicing Odoo13.0
الصورة الرمزية
الصورة الرمزية
1
يناير 22
3198
Payment Method in Invoice Summary Report
pdf reporting invoicing Odoo13.0
الصورة الرمزية
0
فبراير 22
3241
Expected Singleton Error for excel report
reporting invoicing excel Odoo13.0
الصورة الرمزية
1
فبراير 22
61
المجتمع
  • دروس
  • التوثيق
  • المنتدى
مصدر مفتوح
  • تحميل
  • جيت هاب "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