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
    • Diskusi
    • 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

Inherit Qweb

Langganan

Dapatkan notifikasi saat terdapat aktivitas pada post ini

Pertanyaan ini telah diberikan tanda
v8qwebinheritreport
4 Replies
49671 Tampilan
Avatar
Alex

In the new report module we have the company external header in /views/layouts.xml. Its ID is report.external_layout_header. If I edit the view directly in Odoo, it changes but now I want to inherit it in a module and I am not able to do that. I am not a coder so maybe it's a dummy problem.

This is the original view:

<t t-name="report.external_layout_header">
    <div class="header">
        <div class="row">
            <div class="col-xs-3">
                <img t-if="company.logo" t-att-src="'data:image/png;base64,%s' % company.logo" style="max-height: 45px;"/>
            </div>
            <div class="col-xs-9 text-right" style="margin-top:20px;" t-field="company.rml_header1"/>
        </div>
        <div class="row zero_min_height">
            <div class="col-xs-12">
                <div style="border-bottom: 1px solid black;"/>
            </div>
        </div>
        <div class="row">
            <div class="col-xs-3">
                <div t-field="company.partner_id" t-field-options="{&quot;widget&quot;: &quot;contact&quot;, &quot;fields&quot;: [&quot;address&quot;, &quot;name&quot;], &quot;no_marker&quot;: true}" style="border-bottom: 1px solid black;"/>
            </div>
        </div>
    </div>
</t>

 

So I create my module with empty __init__.py and I call the qweb view in __openerp__.py like this:

'qweb': ['views/my_layouts.xml',],

In my_layouts.xml I extend the view like this:

<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>

<templates>

<t t-extend="report.external_layout_header">
            <t t-jquery="div.header" t-operation="replace">

            <<MY CODE>>

            </t>
</t>

</templates>

    </data>
</openerp>

But not works. I can install my module without error but the header doesn't change. I don't know where is the error so any help is appreciated. Thank you.

0
Avatar
Buang
Avatar
Artur Bertram
Jawaban Terbai

Try it with the following code in your "views/my_layouts.xml".

<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>
        <template id="report_header_custom" inherit_id="report.external_layout_header">
            <xpath expr="//div[@class='header']" position="replace">
                <div class ="header">
                    Your Code
                </div>
            </xpath>
        </template>
    </data>
</openerp>

Add the report in youre "__openerp__.py" file in the data.

'data': ['views/my_layouts.xml',],

And dont forget the depends.

'depends': ['base_setup',  'report', ],

7
Avatar
Buang
Avatar
Peter Nietz
Jawaban Terbai

Hi, do you use <templates>  ...   </templates>  in your qweb xml? It is needed.

Another thing could be a dependency. In the __openerp__.py give the dependencies to the report module like:

'depends':['whaterver_report',],

andalso in your __init__.py import ur custom_module.py if one is used.

Then try this in your xml template file:

<templates>

<t t-extend="report.external_layout_header">
            <t t-jquery=".header" t-operation="replace">

                  <div class="header">
                      <div id="change_test"/>

                           <<< your code >>>

                  </div>

            </t>
</t>

</templates>

0
Avatar
Buang
Alex
Penulis

Yes, I use tag. I edit my post sorry. Don't I need to use them?

Alex
Penulis

hahaha same error. I use

Peter Nietz

The tag must be used. Otherwise your code looks fine. I will try to reproduce your problem and have a look at it.

Alex
Penulis

Thank you so much Peter. Furthermore I am just testing so I am not adding difficult code, just deleting for example the company tagline. So I can't understand where is the problem.

Peter Nietz

Inheritence of QWEB isn't very intuitiv ... I now experience the problem that the template from which I inherit produces errors even though I didn't change anything in it, but only my custom template ... why?!?!? So code of my custom modul is now used in standard modules... so where is the point of inheritance?

Peter Nietz

I edited my answer, try it and then take a look with fe. firebug if the id change_test is included. For me this worked. Hope it helps u...

Avatar
Andreas Tolstov
Jawaban Terbai

I think you don't need <openerp> and <data> tags in qweb templates.

Only in view templates.

0
Avatar
Buang
Alex
Penulis

Maybe they are not necessary because if I delete them I have no install error, but don't solve the main problem. Here there is someone with the same problem. https://www.odoo.com/forum/Help-1/question/Edit-the-qweb-template-with-a-custom-modul-54304

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
Create QWeb reports from Odoo application
v8 qweb report
Avatar
0
Des 15
5095
Set report orientation Diselesaikan
v8 qweb report
Avatar
Avatar
1
Mar 15
15038
Edit the qweb template with a custom modul. Diselesaikan
v8 qweb report
Avatar
Avatar
Avatar
3
Mar 15
18827
Transfer the sum of all order lines of one page to the next page.
v8 qweb report
Avatar
0
Mar 15
3934
How do you use variables in a Qweb loop? Diselesaikan
v8 qweb report loop
Avatar
Avatar
Avatar
Avatar
Avatar
11
Apr 23
94481
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