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

Extending kanban: template t-call not working ?

Subscribe

Get notified when there's activity on this post

This question has been flagged
templateskanbant-callV16
1 Reply
2255 Views
Avatar
ALUVAL

Hello,

I'm having a hard time calling an external from a Kanban view, so reaching some help here.

My need: I need to change the logic of presentation of "planned_hours" in Project's Task Kanban card (when hr_timesheet module is installed)

So I've done:

1. Created my new and to-be-called QWeb template "kanban_budget_hours" in a module called "carpentry_timesheet":


<template id="kanban_budget_hours">
    <t t-if="record.planned_hours.raw_value &gt; 0 or record.overtime">
        <t t-set="badge" t-value="'border-success'"/>
        <t t-set="badge" t-value="'border-warning'" t-if="record.progress.raw_value &gt; 0"/>
        <t t-set="badge" t-value="'border-danger'" t-if="record.remaining_hours.raw_value &lt; 0"/>
        <div t-attf-class="oe_kanban_align badge {{ badge }}"
            t-attf-title="Remaining hours. Initialy planned: {{ record.planned_hours.raw_value }}h">
            <field name="remaining_hours" digits="[10,0]" />h
        </div>
        
        <t t-set="badge" t-value="'border-danger'" />
        <t t-set="badge" t-value="'border-success'" t-if="record.performance.raw_value &gt; 0"/>
        <div t-if="record.performance.raw_value" t-attf-class="oe_kanban_align badge {{ badge }}" title="Performance">
            <t t-out="'+'" t-if="record.performance.raw_value &gt; 0"/>
            <field name="performance" digits="[2,0]" />%
        </div>
    </t>
</template>


2. Inherited view hr_timesheet.view_task_kanban_inherited_progress like this:


    <record id="view_task_kanban_inherited_progress" model="ir.ui.view">
        <field name="name">project.task.timesheet.kanban.inherited.progress.carpentry</field>
        <field name="model">project.task</field>
        <field name="inherit_id" ref="hr_timesheet.view_task_kanban_inherited_progress" />

        <field name="arch" type="xml">
            <t name="planned_hours" position="replace">
                <t t-call="carpentry_timesheet.kanban_budget_hours" />
            </t>
        </field>
    </record>



Updating the module (CLI -u carpentry_timesheet) works fine but loading the view in web browser gets me the following error:

OwlError: Missing template: "carpentry_timesheet.kanban_budget_hours"

While i can see in Odoo's settings my template correctly created (sorry I can't submit photo so i'm writing here the View content from View settings):

  • view_name: kanban_budget_hours
  • view_type: QWeb
  • model: none
  • active: true
  • inheritance mode: base
  • model data: kanban_budget_hours
  • external_id:  carpentry_timesheet.kanban_budget_hours

Any thoughs ?

Warm welcome

0
Avatar
Discard
Avatar
ALUVAL
Author Best Answer

Just found the answer: it seems that any template called inside a Kanban view must be declared within the tag of the same Kanban view.

So there cannot be call to external template in Kanban. This is less convenient than for report.

Example:

<t t-name="kanban_sub_part">
    Some sub-part of Kanban view
</t>

<t t-name="kanban-box">
    ....
         <t t-call="kanban_sub_part" />
</t>

0
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
templating: t-if for string length
templates kanban t-if
Avatar
Avatar
2
Jun 16
11029
Odoo Helpdesk Email Template Setup
email templates helpdesk V16
Avatar
Avatar
1
Dec 25
202
How to pass value from employee to contact on odoo 16 using code Solved
V16
Avatar
Avatar
Avatar
Avatar
Avatar
4
Jul 25
2715
How to not show incoming emails in crm chatter Solved
V16
Avatar
Avatar
1
Jul 25
2065
Automatic taxes
V16
Avatar
Avatar
1
Apr 25
1656
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