Skip ke Konten
Odoo Menu
  • Login
  • Uji coba gratis
  • Aplikasi
    Keuangan
    • Akuntansi
    • Faktur
    • Pengeluaran
    • Spreadsheet (BI)
    • Dokumen
    • Tanda Tangan
    Sales
    • CRM
    • Sales
    • POS Toko
    • POS Restoran
    • Langganan
    • Rental
    Website
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Rantai Pasokan
    • Inventaris
    • Manufaktur
    • PLM
    • Purchase
    • Maintenance
    • Kualitas
    Sumber Daya Manusia
    • Karyawan
    • Rekrutmen
    • Cuti
    • Appraisal
    • Referensi
    • Armada
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Acara
    • Otomatisasi Marketing
    • Survei
    Layanan
    • Project
    • Timesheet
    • Layanan Lapangan
    • Meja Bantuan
    • Planning
    • Appointment
    Produktivitas
    • Discuss
    • Approval
    • IoT
    • VoIP
    • Pengetahuan
    • WhatsApp
    Aplikasi pihak ketiga Odoo Studio Platform Odoo Cloud
  • Industri-Industri
    Retail
    • Toko Buku
    • Toko Baju
    • Toko Furnitur
    • Toko Kelontong
    • Toko Hardware
    • Toko Mainan
    Makanan & Hospitality
    • Bar dan Pub
    • Restoran
    • Fast Food
    • Rumah Tamu
    • Distributor Minuman
    • Hotel
    Real Estate
    • Agensi Real Estate
    • Firma Arsitektur
    • Konstruksi
    • Estate Management
    • Perkebunan
    • Asosiasi Pemilik Properti
    Konsultansi
    • Firma Akuntansi
    • Mitra Odoo
    • Agensi Marketing
    • Firma huku
    • Talent Acquisition
    • Audit & Sertifikasi
    Manufaktur
    • Tekstil
    • Logam
    • Perabotan
    • Makanan
    • Brewery
    • Corporate Gift
    Kesehatan & Fitness
    • Sports Club
    • Toko Kacamata
    • Fitness Center
    • Wellness Practitioners
    • Farmasi
    • Salon Rambut
    Perdagangan
    • Handyman
    • IT Hardware & Support
    • Sistem-Sistem Energi Surya
    • Pembuat Sepatu
    • Cleaning Service
    • Layanan HVAC
    Lainnya
    • Organisasi Nirlaba
    • Agen Lingkungan
    • Rental Billboard
    • Fotografi
    • Penyewaan Sepeda
    • Reseller Software
    Browse semua Industri
  • Komunitas
    Belajar
    • Tutorial-tutorial
    • Dokumentasi
    • Sertifikasi
    • Pelatihan
    • Blog
    • Podcast
    Empower Education
    • Program Edukasi
    • Game Bisnis 'Scale Up!'
    • Kunjungi Odoo
    Dapatkan Softwarenya
    • Download
    • Bandingkan Edisi
    • Daftar Rilis
    Kolaborasi
    • Github
    • Forum
    • Acara
    • Terjemahan
    • Menjadi Partner
    • Layanan untuk Partner
    • Daftarkan perusahaan Akuntansi Anda.
    Dapatkan Layanan
    • Temukan Mitra
    • Temukan Akuntan
    • Temui penasihat
    • Layanan Implementasi
    • Referensi Pelanggan
    • Bantuan
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dapatkan demo
  • Harga
  • Bantuan

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

  • CRM
  • e-Commerce
  • Akuntansi
  • Inventaris
  • PoS
  • Project
  • MRP
All apps
Anda harus terdaftar untuk dapat berinteraksi di komunitas.
Semua Post Orang Lencana-Lencana
Label (Lihat semua)
odoo accounting v14 pos v15
Mengenai forum ini
Anda harus terdaftar untuk dapat berinteraksi di komunitas.
Semua Post Orang Lencana-Lencana
Label (Lihat semua)
odoo accounting v14 pos v15
Mengenai forum ini
Help

Custom Qweb report error "QWebException: "'NoneType' object is not callable""

Langganan

Dapatkan notifikasi saat terdapat aktivitas pada post ini

Pertanyaan ini telah diberikan tanda
qwebodooV9
1 Balas
14707 Tampilan
Avatar
zilvinas

Hello, i want create custom report with my custom renderer, i am using Odoo v9 community. I have error message when generating report:

QWebException: "'NoneType' object is not callable" while evaluating
"translate_doc(doc_id, doc_model, 'partner_id.lang', 'custom_module_name.report_object_review_document')"

my custom_module_name_report.xml:

<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<report
string="Object review"
id="action_report_object_review"
model="crm.lead"
report_type="qweb-pdf"
name="custom_module_name.report_object_review"
file="custom_module_name.report_object_review"
/>
</data>
</openerp>

report_object_review.xml:

<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<template id="report_object_review_document">
<t t-foreach="docs" t-as="o">
</div>
<div class="page">
<div class="row">
<h3>Title</h3>
<span t-esc="get_format()"/>
</div>
</div>
</t>
</template>
<template id="report_object_review">
<t t-call="report.html_container">
<t t-foreach="doc_ids" t-as="doc_id">
<t t-raw="translate_doc(doc_id, doc_model, 'partner_id.lang', 'custom_module_name.report_object_review_document')"/>
</t>
</t>
</template>
</data>
</openerp>

custom_module_name.py

from openerp.osv import osv
from openerp import models, fields, api, _
class report_object_review(models.AbstractModel):
_name = 'report.custom_module_name.report_object_review'
_template = 'custom_module_name.report_object_review'
def get_format(self):
return 'some text!!!'
@api.multi
def render_html(self, data=None):
report_obj = self.env['report']
report = report_obj._get_report_from_name(self._template)
docargs = {
'get_format': self.get_format,
'doc_ids': self._ids,
'doc_model': report.model,
'docs': self,
}
return report_obj.render(self._template, docargs)

maybe someone can tell me what is wrong with my code?

thank in advance!

0
Avatar
Buang
Avatar
Axel Mendoza
Jawaban Terbai

Hi zilvinas

Your issue is that there is no translate_doc in Odoo v9. You need to change this:

<t t-raw="translate_doc(doc_id, doc_model, 'partner_id.lang', 'custom_module_name.report_object_review_document')"/>

to this:

<t t-call="custom_module_name.report_object_review_document" t-lang="doc_id.partner_id.lang"/>
1
Avatar
Buang
zilvinas
Penulis

thank you Alex! also need to mention what i have had to change line <t t-foreach="doc_ids" t-as="doc_id"> to <t t-foreach="docs" t-as="o"> and call report

<t t-call="custom_module_name.report_object_review_document" t-lang="o.partner_id.lang"/> also in .py file have had to changeline 'docs': self.env[report.model].browse(self.ids),

if you cat edit your comment, becouse i dont have enouch karma.

Axel Mendoza

no need to change it, all depends of the vars that you are using, if you use doc_id or o, you just need to care about how you name it, but the issue is that the translate_doc is gone and now there is the lang attr for the t-call tag

zilvinas
Penulis

i understand that, but after changing another error was occured. my renderer returns doc_ids as int not a modelname(id) so i have had change it to 'docs' and also i have had to change render function to return docs with correct model name, because my module generates report from crm.lead module not my custom module.

Menikmati diskusi? Jangan hanya membaca, ikuti!

Buat akun sekarang untuk menikmati fitur eksklufi dan agar terlibat dengan komunitas kami!

Daftar
Post Terkait Replies Tampilan Aktivitas
Odoo 18: Display image from char field containing url in qweb form
qweb
Avatar
Avatar
1
Jul 25
3118
PDF Export Option for QWeb Reports in odoo 17.0
qweb
Avatar
Avatar
1
Mei 25
4092
QWeb: use t-if to check birthday date Diselesaikan
qweb
Avatar
Avatar
1
Apr 25
3388
Odoo 17 - QWeb Reports with External Datasource Diselesaikan
qweb
Avatar
Avatar
1
Feb 25
2790
Tree line field shrinked/cut
qweb
Avatar
0
Okt 24
2268
Komunitas
  • Tutorial-tutorial
  • Dokumentasi
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Terjemahan
Layanan
  • Odoo.sh Hosting
  • Bantuan
  • Peningkatan
  • Custom Development
  • Pendidikan
  • Temukan Akuntan
  • Temukan Mitra
  • Menjadi Partner
Tentang Kami
  • Perusahaan kami
  • Aset Merek
  • Hubungi kami
  • Tugas
  • Acara
  • Podcast
  • Blog
  • Pelanggan
  • Hukum • Privasi
  • Keamanan
الْعَرَبيّة 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 adalah rangkaian aplikasi bisnis open source yang mencakup semua kebutuhan perusahaan Anda: CRM, eCommerce, akuntansi, inventaris, point of sale, manajemen project, dan seterusnya.

Mudah digunakan dan terintegrasi penuh pada saat yang sama adalah value proposition unik Odoo.

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