İçereği Atla
Odoo Menü
  • Portal
  • Ücretsiz deneyin
  • Uygulamalar
    Finans
    • Muhasebe
    • Faturalama
    • Masraf Yönetimi
    • Elektronik Çizelge (BI)
    • Belgeler
    • İmza
    Satış
    • Müşteri İlişkileri Yönetimi (CRM)
    • Satış
    • Satış Noktası Mağaza
    • Satış Noktası Restoran
    • Abonelikler
    • Kiralama
    Web Sitesi
    • Web Sitesi Oluşturucu
    • eTicaret
    • Blog
    • Forum
    • Canlı Sohbet
    • eÖğrenme
    Tedarik Zinciri
    • Envanter
    • Üretim
    • Ürün Yaşam Döngüsü Yönetimi
    • Satın Alma
    • Bakım
    • Kalite
    İnsan Kaynakları
    • Çalışanlar
    • İşe Alım
    • İzin
    • Değerlendirme
    • Referans
    • Filo Yönetimi
    Pazarlama
    • Sosyal Medyada Pazarlama
    • E-posta ile Pazarlama
    • SMS ile Pazarlama
    • Etkinlikler
    • Pazarlama Otomasyonu
    • Anket
    Hizmetler
    • Proje Yönetimi
    • Çalışma Çizelgeleri
    • Saha Hizmeti
    • Yardım Masası
    • Planlama
    • Randevular
    Verimlilik
    • Sohbet
    • Onay
    • Nesnelerin İnterneti
    • VoIP
    • Bilgi Bankası
    • WhatsApp
    Üçüncü taraf uygulamalar Odoo Stüdyo Odoo Bulut Platformu
  • Sektörler
    Perakende satış
    • Kitapçı
    • Giyim Mağazası
    • Mobilya Mağazası
    • Gıda Marketi
    • Hırdavat Dükkanı
    • Oyuncak Dükkanı
    Gıda ve Konaklama
    • Bar ve Pub
    • Restoran
    • Fast Food Restoranı
    • Konuk Evi
    • İçecek Distribütörü
    • Otel
    Gayrimenkul
    • Emlak Acentesi
    • Mimarlık Firması
    • İnşaat
    • Emlak Yönetimi
    • Bahçe Tasarımı
    • Mülk Sahipleri Derneği
    Uzmanlık
    • Muhasebe Firması
    • Odoo Partner
    • Pazarlama Ajansı
    • Hukuk Firması
    • Yetenek Kazanımı
    • Denetim ve Belgelendirme
    Üretim
    • Tekstil
    • Metal
    • Mobilyalar
    • Gıda
    • Bira fabrikası
    • Kurumsal Hediye
    Sağlık ve Spor
    • Spor Kulübü
    • Optik Mağazası
    • Fitness Merkezi
    • Sağlıklı Yaşam Merkezi
    • Eczane
    • Kuaför Salonu
    Ticaret
    • Tamirci
    • BT Donanım & Destek
    • Güneş Enerjisi Sistemleri
    • Ayakkabı İmalatçısı
    • Temizlik Hizmetleri
    • HVAC Hizmetleri
    Diğerleri
    • Kar Amacı Gütmeyen Kuruluş
    • Çevre Ajansı
    • Reklam Panosu Kiralama
    • Fotoğrafçılık
    • Bisiklet Kiralama
    • Yazılım Bayisi
    Tüm Sektörlere Göz Atın
  • Topluluk
    Öğrenim
    • Eğitim Araçları
    • Dokümantasyon
    • Sertifikasyonlar
    • Eğitim Etkinlikleri
    • Blog
    • Podcast
    Eğitim ve Gelişim
    • Eğitim Programı
    • Scale Up! İşletme Oyunu
    • Odoo'yu Ziyaret Edin
    Yazılım
    • İndirin
    • Sürümleri Kıyaslayın
    • Sürümler
    İş Birliği
    • Github
    • Forum
    • Etkinlikler
    • Çeviriler
    • Partner Olun
    • Partnerler için Hizmetler
    • Muhasebe Firmanızı Kaydettirin
    Hizmetler
    • Partner Bulun
    • Muhasebeci Bulun
    • Bir danışmanla görüşün
    • Kurulum Hizmetleri
    • Müşteri Referansları
    • Destek
    • Sürüm Yükseltme
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Demo randevusu alın
  • Fiyatlandırma
  • Yardım

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

  • Müşteri İlişkileri Yönetimi
  • e-Commerce
  • Muhasebe
  • Envanter
  • PoS
  • Proje Yönetimi
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiketler (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiketler (View all)
odoo accounting v14 pos v15
About this forum
Yardım

How to get the data inorder to generate an excel report?

Abone Ol

Get notified when there's activity on this post

Bu soru işaretlendi
pythonreportexceltableodoo10
2 Cevaplar
7417 Görünümler
Avatar
Kinah Guinto

Hello,
I am new in odoo. I wanted to generate a report - an excel format. I am looking for a python approach example for these sample data.

This my xml for the qweb in my pdf format:

<tbody class="table_data">
<t t-set="pickings" t-value="o.get_pickings(date_start, date_end)" />
<t t-foreach="pickings" t-as="pick">
<t t-set="line_items" t-value="o.get_line_items(pick)"/>
    <t t-foreach="line_items" t-as="line">
        <tr>
         <td><span t-esc="i"/><t t-set="i" t-value="i+1"/></td>
            <td><span t-esc="line.get('partner_name')" /></td>
            <td><span t-esc="line.get('si_number')" /></td>
            <td><span t-esc="line.get('product_name')" /></td>
            <td><span t-esc="line.get('done_qty')" /></td>
            <t t-set="qty" t-value="qty + line.get('done_qty')"/>
        </tr>
    </t>
</t>
<tr class="total">
<td colspan="3"></td>
<td><span>Total:</span></td>
<td><span t-esc="qty" /></td>
</tr>
</tbody>

I tried to display this in excel but got error.

the items:

    @api.multi
    def get_line_items(self, picking_id):
        line_items = picking_id.pack_operation_ids
        items = []
        for item in line_items:
            items.append({"product_name": item.product_id.name, "done_qty": item.qty_done, 
                          "si_number": " ".join([ invoice.name for invoice in picking_id.sale_id.invoice_ids]),
                          "partner_name": picking_id.partner_id.name })
        
       
        return items


for excel:

        sheet.write(0, 1, "REPORT", header_title)    
        sheet.write(4, 0, "CUSTOMER NAME")
        sheet.write(4, 1, "I.S. #")
        sheet.write(4, 2, "PRODUCT NAME")
        sheet.write(4, 3, "NO. OF BAGS")
               
        get_line_items = self.get_line_items(picking_id)     
                
        for i in get_line_items:
            print("get_line_items",i)      

error:

get_line_items = self.get_line_items(picking_id)
NameError: global name 'picking_id' is not defined
0
Avatar
Vazgeç
Avatar
sunandan
En İyi Yanıt

You can try this connector from odoo appstore
It is easy to install and is integrated in excel itself
https://apps.odoo.com/apps/modules/18.0/excel_connector

3
Avatar
Vazgeç
Avatar
Niyas Raphy (Walnut Software Solutions)
En İyi Yanıt

Hi,

If you are looking how to create excel report in odoo, see this tutorial explaining the same:  How to Create Excel report in Odoo


An example of XLSX report for partners on a module called module_name:

A python class

from odoo import models

class PartnerXlsx(models.AbstractModel):
    _name = 'report.module_name.report_name'
    _inherit = 'report.report_xlsx.abstract'

    def generate_xlsx_report(self, workbook, data, partners):
        for obj in partners:
            report_name = obj.name
            # One sheet by partner
            sheet = workbook.add_worksheet(report_name[:31])
            bold = workbook.add_format({'bold': True})
            sheet.write(0, 0, obj.name, bold)

To manipulate the workbook and sheet objects, refer to the documentation of xlsxwriter.

A report XML record

<report
    id="partner_xlsx"
    model="res.partner"
    string="Print to XLSX"
    report_type="xlsx"
    name="module_name.report_name"
    file="res_partner"
    attachment_use="False"
/>
Supporting Module:  Base report xlsx

Thanks

0
Avatar
Vazgeç
Kinah Guinto
Üretici

Hello, thank you for your kind response. I updated my post. I am having an error to get the items from get_line_items().

Niyas Raphy (Walnut Software Solutions)

get_line_items = self.get_line_items(picking_id) , what is picking_id here refers to ?

Kinah Guinto
Üretici

@api.multi

def get_partner_name(self, picking_id):

partner_name = picking_id.partner_id.name

return partner_name

@api.multi

def get_line_items(self, picking_id):

line_items = picking_id.pack_operation_ids

items = []

for item in line_items:

items.append({"product_name": item.product_id.name, "done_qty": item.qty_done,

"si_number": " ".join([ invoice.name for invoice in picking_id.sale_id.invoice_ids]),

"partner_name": picking_id.partner_id.name })

return items

Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Üye Ol
İlgili Gönderiler Cevaplar Görünümler Aktivite
Generate excel with a button
python report excel odoo12
Avatar
1
Tem 21
176
Excel report
python report excel odoo12
Avatar
0
Nis 21
331
Unknown report type: xlsx: - Odoo 10
report excel xlsx odoo10
Avatar
Avatar
1
Kas 18
6932
How to add image in excel report using python xlwt ? Çözüldü
python image report excel xlwt
Avatar
Avatar
3
Kas 17
24075
error ConfigParser.ParsingError: File contains parsing errors
python odoo10
Avatar
0
Mar 21
7675
Topluluk
  • Eğitim Araçları
  • Dokümantasyon
  • Forum
Açık Kaynak
  • İndirin
  • Github
  • Runbot
  • Çeviriler
Hizmetler
  • Odoo.sh Hosting
  • Destek
  • Sürüm Yükseltme
  • Özel Geliştirmeler
  • Eğitim
  • Muhasebeci Bulun
  • Partner Bulun
  • Partner Olun
Hakkında
  • Şirketimiz
  • Pazarlama Gereçleri
  • İletişim
  • Kariyer
  • Etkinlikler
  • Podcast
  • Blog
  • Müşteriler
  • Hukuki • Gizlilik
  • Güvenlik
الْعَرَبيّة 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, müşteri ilişkileri yönetimi, eTicaret, muhasebe, envanter, satış noktası, proje yönetimi gibi şirketinizin tüm ihtiyaçlarını karşılayan bir açık kaynak işletme uygulamaları paketidir.

Odoo’nun eşsiz değer önermesi, aynı anda hem kullanımının çok kolay olup hem de tamamen entegre olmasıdır.

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