Přejít na obsah
Odoo Menu
  • Přihlásit se
  • Vyzkoušejte zdarma
  • Aplikace
    Finance
    • Účetnictví
    • Fakturace
    • Výdaje
    • Spreadsheet (BI)
    • Dokumenty
    • Podpisy
    Prodej
    • CRM
    • Prodej
    • POS Obchod
    • POS Restaurace
    • Předplatné
    • Pronájem
    Webové stránky
    • Webové stránky
    • E-shop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Dodavatelský řetězec
    • Sklad
    • Výroba
    • PLM
    • Nákup
    • Údržba
    • Kvalita
    Lidské zdroje
    • Zaměstnanci
    • Nábor
    • Volno
    • Hodnocení zaměstnanců
    • Doporučení
    • Vozový park
    Marketing
    • Marketing sociálních sítí
    • Emailový marketing
    • SMS Marketing
    • Události
    • Marketingová automatizace
    • Dotazníky
    Služby
    • Projekt
    • Časové výkazy
    • Práce v terénu
    • Helpdesk
    • Plánování
    • Schůzky
    Produktivita
    • Diskuze
    • Schvalování
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Aplikace třetích stran Odoo Studio Odoo cloudová platforma
  • Branže
    Maloobchod
    • Knihkupectví
    • Obchod s oblečením
    • Obchod s nábytkem
    • Potraviny
    • Obchod s hardwarem
    • Hračkářství
    Jídlo a pohostinství
    • Bar a Pub
    • Restaurace
    • Fast Food
    • Penzion
    • Distributor nápojů
    • Hotel
    Nemovitost
    • Realitní kancelář
    • Architektonická firma
    • Stavba
    • Správa nemovitostí
    • Zahradnictví
    • Asociace vlastníků nemovitosti
    Poradenství
    • Účetní firma
    • Odoo Partner
    • Marketingová agentura
    • Právník
    • Akvizice talentů
    • Audit a certifikace
    Výroba
    • Textil
    • Kov
    • Nábytek
    • Jídlo
    • Pivovar
    • Korporátní dárky
    Zdraví a fitness
    • Sportovní klub
    • Prodejna brýli
    • Fitness Centrum
    • Wellness praktikové
    • Lékárna
    • Kadeřnictví
    Transakce
    • Údržbář
    • Podpora IT & hardware
    • Systémy solární energie
    • Výrobce obuvi
    • Úklidové služby
    • Služby HVAC
    Ostatní
    • Nezisková organizace
    • Agentura pro životní prostředí
    • Pronájem billboardů
    • Fotografování
    • Leasing jízdních kol
    • Prodejce softwaru
    Procházet všechna odvětví
  • Komunita
    Edukační program
    • Tutoriály
    • Dokumentace
    • Certifikace
    • Vzdělávání
    • Blog
    • Podcast
    Podpora vzdělávání
    • Vzdělávací program
    • Scale Up! Hra na firmu
    • Navštivte Odoo
    Získat software
    • Stáhnout
    • Porovnejte edice
    • Verze
    Spolupráce
    • Github
    • Fórum
    • Události
    • Překlady
    • Stát se partnerem
    • Služby pro partnery
    • Registrujte svou účetní firmu
    Získat služby
    • Najít partnera
    • Najít účetní
    • Setkejte se s poradcem
    • Implementační služby
    • Zákaznické reference
    • Podpora
    • Upgrady
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dohodnout demo
  • Ceník
  • Pomoc

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

  • CRM
  • e-Commerce
  • Účetnictví
  • Sklad
  • PoS
  • Projekty
  • MRP
All apps
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
Pomoc

Why does my qWeb inheritance affect the base module from which I inherit?

Odebírat

Get notified when there's activity on this post

This question has been flagged
inheritanceqwebv7kanbanwebmodule
1 Odpovědět
5819 Zobrazení
Avatar
Peter Nietz

I try to write a custom module where the web_kanban modul is inherited:

<template>
<t t-name="KanbanView">
    <div class="oe_kanban_view">
        <div class="oe_kanban_buttons"/>
        <table class="oe_kanban_groups">
        <tr class="oe_kanban_groups_headers">
            <td class="oe_kanban_dummy_cell"><div/></td>
        </tr>
        <tr class="oe_kanban_groups_records">
            <td class="oe_kanban_dummy_cell"><div/></td>
        </tr>
        </table>
    </div>
</t>
[...]
</template>

For testing reasons I only added a div tag with an ID to check if my changes are visible:

<t t-extend="KanbanView">
   <t t-jquery=".oe_kanban_view" t-operation="replace">
       <div class="oe_kanban_view">
           <div id="change_test"/>
           <div class="oe_kanban_buttons"/>
           <table class="oe_kanban_groups">
             <tr class="oe_kanban_groups_headers">
                <td class="oe_kanban_dummy_cell"><div/></td>
             </tr>
             <tr class="oe_kanban_groups_records">
                <td class="oe_kanban_dummy_cell"><div/></td>
             </tr>
           </table>
       </div>
   </t>
</t>

I works fine in my custom module, but also affects different views in openERP!

For example: If I check the kanban View of [Settings / Installed Modules] I will also find:

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

Can someone explain this behavior? Do I understand the inheritance right?

[EDIT]

At  http://doc.openerp.com/trunk/web/qweb/   I found this:

t-extend=template BODY

Parameters:

template (String) -- name of the template to extend

Works similarly to OpenERP models: if used on its own, will alter the specified template in-place; if used in conjunction with t-name will create a new template using the old one as a base.

But if i add a t-name like

<t t-extend="KanbanView" t-name="CustomKanbanView">

my custom template isn't used anymore. How do I tell openERP to use my CustomTemplate instead of the standard?

0
Avatar
Zrušit
Avatar
Ivan Elizaryev
Nejlepší odpověď

It is not a typical inheritance, so it's not easy to do. But if you are really need it, you have to very serious modifications in javascript. Below I made only beginning.

 

I found "KanbanView" in a file web/addons/web_kanban/static/src/js/kanban.js

So, you can create another KanbanView with this js code:

instance.web.views.add('kanban2', 'instance.web_kanban.KanbanView2');

 

instance.web_kanban.KanbanView2 = instance.web_kanban.KanbanView.extend({template: "KanbanView"})

In order to use kanban2 you have to find a place in a web client where 'kanban' view is used and add there kanban2.

 

1
Avatar
Zrušit
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Přihlásit se
Related Posts Odpovědi Zobrazení Aktivita
How to modify a qweb template? Vyřešeno
inheritance qweb
Avatar
Avatar
2
pro 22
24203
Qweb Inheritance Vyřešeno
inheritance qweb
Avatar
Avatar
Avatar
3
lis 19
8950
create Kanban view in openerp 7.0
qweb kanban
Avatar
Avatar
1
srp 17
23463
Injecting a widget under the product price
inheritance qweb website_sale
Avatar
Avatar
2
led 24
2104
Replace all Qweb template using inheritance Vyřešeno
survey inheritance qweb
Avatar
Avatar
Avatar
2
pro 21
23772
Komunita
  • Tutoriály
  • Dokumentace
  • Fórum
Open Source
  • Stáhnout
  • Github
  • Runbot
  • Překlady
Služby
  • Odoo.sh hostování
  • Podpora
  • Upgrade
  • Nestandardní vývoj
  • Edukační program
  • Najít účetní
  • Najít partnera
  • Stát se partnerem
O nás
  • Naše společnost
  • Podklady značky
  • Kontakujte nás
  • Práce
  • Události
  • Podcast
  • Blog
  • Zákazníci
  • Právní dokumenty • Soukromí
  • Zabezpečení
الْعَرَبيّة 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 je balíček open-source aplikací, které pokrývají všechny potřeby vaší společnosti: CRM, e-shop, účetnictví, sklady, kasy, projektové řízení a další.

Unikátní nabídka od Odoo poskytuje velmi jednoduché uživatelské rozhraní a vše je integrované na jednom místě.

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