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

Qweb Report based on wizard started from a menu!

Abone Ol

Get notified when there's activity on this post

Bu soru işaretlendi
wizardqweb
2 Cevaplar
9996 Görünümler
Avatar
Matjaz

I am trying to create a qweb report that is not based on certain record of module, but I would create a dictionary of records

and pass them to qweb template. I've done this on RML reports but here 'data['form'] is not recognized of qweb template. Data is empty.

User starts a wizard from a menu, where he selects month and year. After that data is prepared as a dictionary and is passed to the report.

Wizard part:

datas = {
     'ids': ids,
, 'model': 'report.environmental.oils.wizard',
 'form': data
}
return {
     'type': 'ir.actions.report.xml',
     'report_name': 'mga_reports.report_environmental_oils',
data': datas, }

Report declaration:

<report        
id="action_report_environmental_oils"     
model="report.environmental.oils.wizard"     
name="mga_reports.report_environmental_oils"     
file="mga_reports.report_environmental_oils"     
report_type="qweb-pdf"     
menu="False"     
string="Environmental oils report"/>


I am not sure what model should I use in report definition, because report is not based on one, data will be computed from several one. I have also created parser file and data argument that comes in is empty

@api.multidef render_html(self, data=None):    
    report_obj = self.env['report']
    report = report_obj._get_report_from_name('mga_reports.report_environmental_oils')
    docargs = {
        'doc_ids': self._ids,
        'doc_model': report.model,
        'docs': self,          
} return report_obj.render('mga_reports.report_environmental_oils', docargs)


When I use data in qweb template data is empty in a got error.

<p t-esc="data['form']['date_from']"/>


Could someone help me with that case. I'm kind of lost... :-(

0
Avatar
Vazgeç
Avatar
Matjaz
Üretici En İyi Yanıt

Thanks Axel,

I already have parser with render_html method and since I have an id from wizard I can do all the 'calculation' / preparing data dictionary there and than pass than dictionary to docargs. It just took me a day of tests to find out that dictionary passed to docargs in parser class are recognized in Qweb template while passing it as a result of wizard as (data or datas) not.

@api.multi
def render_html(self, data=None):
         report_obj = self.env['report']
         report = report_obj._get_report_from_name('mga_reports.report_environmental_oils')
         dict_mydata = { ..do some calculation and prepare a dictionary.. }
         docargs = {
             'doc_ids': self._ids,
             'doc_model': report.model,
             'docs': self,
           'mydata': dict_mydata
        }
        return report_obj.render('mga_reports.report_environmental_oils', docargs)

But a lot of reports in Odoo are done as passing as a result of wizard, but all are based on certain model and mine doesn't.

Ok, I found a solution, but If someone has an answer to why do I have to use parser and Odoo reports doesn't....

0
Avatar
Vazgeç
Avatar
Axel Mendoza
En İyi Yanıt

You are good to go with your code and the only way to receive the data in your parser is implementing the parser using an AbstractModel with the render_html method. The only thing is that 'datas' is what it's expected in the report controller to call your parser. You need to change your code:

return {

'type': 'ir.actions.report.xml',

'report_name': 'mga_reports.report_environmental_oils',

'datas': datas,

It's a bug or something missed on the get_action method of the report module that use 'data' instead of 'datas' in the return dict, but datas find it's way to the parser ok

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
[odoo9] : Report content and header footer issue with wizard
wizard qweb odoo9
Avatar
Avatar
1
Eyl 17
5314
How can i use values from a print wizard in a qweb parser method?
wizard qweb parser
Avatar
0
Nis 15
4726
Odoo 18: Display image from char field containing url in qweb form
qweb
Avatar
Avatar
1
Tem 25
2984
PDF Export Option for QWeb Reports in odoo 17.0
qweb
Avatar
Avatar
1
May 25
3773
QWeb: use t-if to check birthday date Çözüldü
qweb
Avatar
Avatar
1
Nis 25
3264
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