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 > 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 > 0"/> <t t-set="badge" t-value="'border-danger'" t-if="record.remaining_hours.raw_value < 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 > 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 > 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