İç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 download Excel File in Odoo

Abone Ol

Get notified when there's activity on this post

Bu soru işaretlendi
xmlreportsexceljsodoo11
2 Cevaplar
10617 Görünümler
Avatar
Gagandeep Kaur

I Created two buttons one for creating excel file and one for downloading created excel file. My XML code:

<group string="Employee Attendance">
                                          <group>
                                      <button string="Generate Attendance" name="generate_attendance_file" type="object"/>
                                      </group>
                                      <group>
                                        <button string="Download Attendance File" name="download_attendance_file" type="download_file" />

                                          </group>
                                    </group>

And my Python code:

def generate_attendance_file(self):
        workbook = xlsxwriter.Workbook('test.xlsx')
        worksheet1 = workbook.add_worksheet('My 1')
        worksheet1.write('A1','Col 1')
        worksheet1.write('B1','Col 2')
        worksheet1.write('C1','Col 3')
        db = pyodbc.connect('DRIVER={SQL Server};SERVER=OWNER-PC\SQLEXPRESS;DATABASE=etimetracklite;UID=test;PWD=rimt')
        cursor = db.cursor()
        sql = "select StatusCode from AttendanceLogs where EmployeeId='3010' AND AttendanceDate Between '2018-11-1' AND '2018-11-14'"
        cursor.execute(sql)
        results = cursor.fetchall()
        i = 2;
        for row in results:
            worksheet1.write('A' + str(i), row[0])
            i += 1
        bold = workbook.add_format({'bold': True})
        db.close()
        workbook.close()


   
    @api.multi
    def download_attendance_file(self):
        wb = xlrd.open_workbook('test.xlsx')
        output = io.Bytes()
        workbook.save(output)
        output.seek(0)
        data = output.read()
        return data

But I have following issue in downloading button:

Error:
TypeError: this.do_execute_action(...) is undefined

http://localhost:8069/web/content/1960-cc3f4ba/web.assets_backend.js:469
Traceback:
execute_action@http://localhost:8069/web/content/1960-cc3f4ba/web.assets_backend.js:469:620
proxy/<@http://localhost:8069/web/content/1723-e9a3b9f/web.assets_common.js:3923:8
trigger@http://localhost:8069/web/content/1723-e9a3b9f/web.assets_common.js:3921:166
_trigger_up@http://localhost:8069/web/content/1723-e9a3b9f/web.assets_common.js:3927:340
_trigger_up@http://localhost:8069/web/content/1723-e9a3b9f/web.assets_common.js:3927:442
trigger_up@http://localhost:8069/web/content/1723-e9a3b9f/web.assets_common.js:3927:275
_callButtonAction@http://localhost:8069/web/content/1960-cc3f4ba/web.assets_backend.js:1310:1689
saveAndExecuteAction/<@http://localhost:8069/web/content/1960-cc3f4ba/web.assets_backend.js:1412:648
then/</</<@http://localhost:8069/web/content/1723-e9a3b9f/web.assets_common.js:802:678
fire@http://localhost:8069/web/content/1723-e9a3b9f/web.assets_common.js:796:281
add@http://localhost:8069/web/content/1723-e9a3b9f/web.assets_common.js:797:467
then/</<@http://localhost:8069/web/content/1723-e9a3b9f/web.assets_common.js:802:649
each@http://localhost:8069/web/content/1723-e9a3b9f/web.assets_common.js:625:758
then/<@http://localhost:8069/web/content/1723-e9a3b9f/web.assets_common.js:802:553
Deferred@http://localhost:8069/web/content/1723-e9a3b9f/web.assets_common.js:803:189
then@http://localhost:8069/web/content/1723-e9a3b9f/web.assets_common.js:802:518
saveAndExecuteAction@http://localhost:8069/web/content/1960-cc3f4ba/web.assets_backend.js:1412:577
_onButtonClicked@http://localhost:8069/web/content/1960-cc3f4ba/web.assets_backend.js:1413:340
proxy/<@http://localhost:8069/web/content/1723-e9a3b9f/web.assets_common.js:3923:8
trigger@http://localhost:8069/web/content/1723-e9a3b9f/web.assets_common.js:3921:166
_trigger_up@http://localhost:8069/web/content/1723-e9a3b9f/web.assets_common.js:3927:340
_trigger_up@http://localhost:8069/web/content/1723-e9a3b9f/web.assets_common.js:3927:442
trigger_up@http://localhost:8069/web/content/1723-e9a3b9f/web.assets_common.js:3927:275
_addOnClickAction/<@http://localhost:8069/web/content/1960-cc3f4ba/web.assets_backend.js:1372:329
dispatch@http://localhost:8069/web/content/1723-e9a3b9f/web.assets_common.js:892:378
add/elemData.handle@http://localhost:8069/web/content/1723-e9a3b9f/web.assets_common.js:865:151

0
Avatar
Vazgeç
Avatar
Manish Bohra
En İyi Yanıt

Hello,

Check below code for how to create xls report

class SalesXlsx(ReportXlsx):

    def generate_xlsx_report(self, workbook, data, sales_order):
        sheet = workbook.add_worksheet('Sales Customer Report')
        bold = workbook.add_format({'bold': True})
        sheet.write(0, 0, 'Customer', bold)
        sheet.write(0, 1, 'Number', bold)
        for index, obj in enumerate(rental):
            index = index+1
            if obj.partner_id:sheet.write(index, 0, obj.partner_id)
            if obj.telephone:sheet.write(index, 1, obj.telephone)
           
RentalXlsx('sale.order.xlsx', 'sale.order')


May Be it's help you.

4
Avatar
Vazgeç
Avatar
Gagandeep Kaur
Üretici En İyi Yanıt

same error

Error:
TypeError: this.do_execute_action(...) is undefined

http://localhost:8069/web/content/1960-cc3f4ba/web.assets_backend.js:469
Traceback:
execute_action@http://localhost:8069/web/content/1960-cc3f4ba/web.assets_backend.js:469:620
proxy/<@http://localhost:8069/web/content/1723-e9a3b9f/web.assets_common.js:3923:8
trigger@http://localhost:8069/web/content/1723-e9a3b9f/web.assets_common.js:3921:166
_trigger_up@http://localhost:8069/web/content/1723-e9a3b9f/web.assets_common.js:3927:340
_trigger_up@http://localhost:8069/web/content/1723-e9a3b9f/web.assets_common.js:3927:442
trigger_up@http://localhost:8069/web/content/1723-e9a3b9f/web.assets_common.js:3927:275
_callButtonAction@http://localhost:8069/web/content/1960-cc3f4ba/web.assets_backend.js:1310:1689
saveAndExecuteAction/<@http://localhost:8069/web/content/1960-cc3f4ba/web.assets_backend.js:1412:648
then/</</<@http://localhost:8069/web/content/1723-e9a3b9f/web.assets_common.js:802:678
fire@http://localhost:8069/web/content/1723-e9a3b9f/web.assets_common.js:796:281
add@http://localhost:8069/web/content/1723-e9a3b9f/web.assets_common.js:797:467
then/</<@http://localhost:8069/web/content/1723-e9a3b9f/web.assets_common.js:802:649
each@http://localhost:8069/web/content/1723-e9a3b9f/web.assets_common.js:625:758
then/<@http://localhost:8069/web/content/1723-e9a3b9f/web.assets_common.js:802:553
Deferred@http://localhost:8069/web/content/1723-e9a3b9f/web.assets_common.js:803:189
then@http://localhost:8069/web/content/1723-e9a3b9f/web.assets_common.js:802:518
saveAndExecuteAction@http://localhost:8069/web/content/1960-cc3f4ba/web.assets_backend.js:1412:577
_onButtonClicked@http://localhost:8069/web/content/1960-cc3f4ba/web.assets_backend.js:1413:340
proxy/<@http://localhost:8069/web/content/1723-e9a3b9f/web.assets_common.js:3923:8
trigger@http://localhost:8069/web/content/1723-e9a3b9f/web.assets_common.js:3921:166
_trigger_up@http://localhost:8069/web/content/1723-e9a3b9f/web.assets_common.js:3927:340
_trigger_up@http://localhost:8069/web/content/1723-e9a3b9f/web.assets_common.js:3927:442
trigger_up@http://localhost:8069/web/content/1723-e9a3b9f/web.assets_common.js:3927:275
_addOnClickAction/<@http://localhost:8069/web/content/1960-cc3f4ba/web.assets_backend.js:1372:329
dispatch@http://localhost:8069/web/content/1723-e9a3b9f/web.assets_common.js:892:378
add/elemData.handle@http://localhost:8069/web/content/1723-e9a3b9f/web.assets_common.js:865:151

0
Avatar
Vazgeç
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
Displaying Latitude and Longitude using js, in odoo 11 form.
xml js python3 odoo11
Avatar
Avatar
Avatar
2
Eyl 18
7989
Widget creation error in odoo 11
javascript xml widget js odoo11
Avatar
Avatar
1
Oca 19
6137
How to save excel file with the name or id of currently logged user in odoo v11
filename report reports excel odoo11
Avatar
0
Ara 18
4244
Cannot download report with .xls extension Odoo 11.0
reporting report reports excel odoo11
Avatar
Avatar
Avatar
2
Nis 18
8388
How to get field value from javascript to odoo form view in odoo 11 Çözüldü
js odoo11
Avatar
Avatar
Avatar
4
Ara 23
18467
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