İç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

Generate PDF Report From Wizard

Abone Ol

Get notified when there's activity on this post

Bu soru işaretlendi
accountingwizardreportingreport
2 Cevaplar
7919 Görünümler
Avatar
Kevin

Hello, can someone help me, I want to generate a pdf from a wizard, I already have the template and the xml action, but when I call the wizard method to generate the pdf, it generates it blank without any information, currently what the wizard does is generate a ledger modified to another tree view of another model, so I want the option to also generate it in pdf with the same information of the method that it generates when generating the other view:

This is the method that generates another view of another model with the info:

def confirm_export(self):
move_lines = self.env['account.move.line'].search([
('account_id', 'in', self.account_ids.ids),
('date', '>=', self.start_date),
('date', '<=', self.end_date),
('move_id.state', '=', 'posted'), # Filtrar movimientos publicados
])

ledger_view_records = defaultdict(lambda: {'debit_total': 0.0, 'credit_total': 0.0, 'balance_total': 0.0,
'balance_acumulado': 0.0})
for move_line in move_lines.sorted(key=lambda r: r.date):
key = (move_line.date, move_line.journal_id, move_line.account_id)
ledger_view_records[key]['account_id'] = move_line.account_id.id
ledger_view_records[key]['journal_id'] = move_line.journal_id.id
ledger_view_records[key]['date'] = move_line.date
ledger_view_records[key]['currency_id'] = move_line.currency_id.id
ledger_view_records[key]['debit_total'] += move_line.debit
ledger_view_records[key]['credit_total'] += move_line.credit
ledger_view_records[key]['balance_acumulado'] += move_line.cumulated_balance
ledger_view_records[key]['balance_total'] += move_line.balance

export_general_ledger_view = self.env['export.general.ledger.view']
created_records = export_general_ledger_view.create(list(ledger_view_records.values()))

# Abrir la vista después de guardar los datos
action = self.env.ref('general_ledger_sv.action_export_general_ledger_view').read()[0]
action['domain'] = [('id', 'in', created_records.ids)]
return action

This is the xml action and template id:

<record id="report_general_ledger" model="ir.actions.report">
<field name="name">Libro Mayor PDFfield>
<
field name="model">export.general.ledger.viewfield>
<
field name="report_type">qweb-pdffield>
<
field name="report_name">general_ledger_sv.report_general_ledger_sv_template_idfield>
<
field name="report_file">general_ledger_sv.report_general_ledger_sv_template_idfield>
<
field name="binding_model_id" ref="general_ledger_sv.model_export_general_ledger_view"/>
<
field name="binding_type">reportfield>
<
field name="binding_view_types">treefield>
record>

This is the current method to export to pdf:


def generate_pdf(self):
# Obtener los valores del modelo export.general.ledger.view
ledger_view = self.env['export.general.ledger.view'].browse(self._context.get('active_ids', []))

data = {
'model_id': ledger_view.id,
'date': ledger_view.date,
'account_id': ledger_view.account_id,
'journal_id': ledger_view.journal_id,
'debit_total': ledger_view.debit_total,
'credit_total': ledger_view.credit_total,
'balance_total': ledger_view.balance_total,
'balance_acumulado': ledger_view.balance_acumulado,
'currency_id': ledger_view.currency_id,
}

docids = ledger_view.ids
return self.env.ref('general_ledger_sv.report_general_ledger').report_action(docids=docids, data=data)
0
Avatar
Vazgeç
Avatar
Niyas Raphy (Walnut Software Solutions)
En İyi Yanıt

Hi,

When you are printing the data from wizard the data may not have been passed to the report and thus it fails to render the values in the template.

You can check the values, you are returning inside the variable docids and data from wizard and ensure the needed values are passed.

Also you can check out this video explaining the same:  https://www.youtube.com/watch?v=3UJ8UfP48B4


Thanks

0
Avatar
Vazgeç
Avatar
Cybrosys Techno Solutions Pvt.Ltd
En İyi Yanıt

Hi,
In certain conditions, we need to print the report from a button or wizard. In that condition, we use the print button inside the wizard or form to call the report action.

Please refer to the blog topic How to Create a PDF Report in Odoo :https://www.cybrosys.com/blog/how-to-create-a-pdf-report-in-odoo-15

Hope it helps

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
How to generate a report from a wizard?
wizard reporting report
Avatar
Avatar
1
Nis 24
33093
Odoo Online 18.4: Mapping Spanish Chart of Accounts to US for Trial Balance Report Çözüldü
accounting reporting
Avatar
Avatar
1
Eki 25
445
What types of subformulas are there in a financial report? Çözüldü
accounting report
Avatar
Avatar
1
Eyl 25
1427
What content in Python files for report invoice document
accounting reporting
Avatar
1
Nis 25
2100
How to perform automatic year-end accounting entries?
accounting reporting
Avatar
0
Mar 25
1852
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