Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Pricing
  • Help

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

  • CRM
  • e-Commerce
  • Accounting
  • Inventory
  • PoS
  • Project
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
Help

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

Subscribe

Get notified when there's activity on this post

This question has been flagged
inheritanceqwebv7kanbanwebmodule
1 Reply
5817 Views
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
Discard
Avatar
Ivan Elizaryev
Best Answer

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
Discard
Enjoying the discussion? Don't just read, join in!

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

Sign up
Related Posts Replies Views Activity
How to modify a qweb template? Solved
inheritance qweb
Avatar
Avatar
2
Dec 22
24203
Qweb Inheritance Solved
inheritance qweb
Avatar
Avatar
Avatar
3
Nov 19
8949
create Kanban view in openerp 7.0
qweb kanban
Avatar
Avatar
1
Aug 17
23463
Injecting a widget under the product price
inheritance qweb website_sale
Avatar
Avatar
2
Jan 24
2104
Replace all Qweb template using inheritance Solved
survey inheritance qweb
Avatar
Avatar
Avatar
2
Dec 21
23771
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security
الْعَرَبيّة 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 is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

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