-1

In opportunity kanban view I want to remove certain element. It is a span in web_kanban template with t-name="Kanban.Group". I followed this thread How to inherit a template with no ID in Odoo? and related documentation.

I put this

<t t-extend="KanbanView.Group">
    <t t-jquery="span.o_kanban_config" t-operation="replace"></t>
</t>

in opportunities kanban template and I also made it a separate xml:

<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <template>
        <t t-extend="KanbanView.Group">
            <t t-jquery="span.o_kanban_config" t-operation="replace"></t>
        </t>
    </template>
</odoo>

(in this case I appended its name to module's manifest - in 'qweb' list). None of these approaches worked.

Contrary to what I have read about template inheritance, I also tried to use <t t-extend="web_kanban.template">, just in case Odoo needs the modules name just like when inheriting classic views...

Did I do something wrong or miss something? Is there a better/more suitable way to update template?


SOLVED

Finally it works.

I created a separate xml. As I decided to have folding arrows I put this code in it:

<template>
    <t t-extend="KanbanView.Group">
        <t t-jquery=".o_kanban_config.dropdown" t-operation="inner">
                <a class="o_kanban_toggle_fold" href="#"><i class="fa fa-arrows-h"/></a>
        </t>
    </t>
</template>

I added a declaration to openerp.py manifest:

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

Now only a folding arrow is displayed, no other options (Edit, duplicate etc.).

Community
  • 1
  • 1
Juraj Bezručka
  • 512
  • 5
  • 21
  • It works finally. Don't know what happened, probably a browser restart or something. I inherited a template as written in question, but without xml declaration and element. XML is declared in 'qweb' list of manifest. – Juraj Bezručka Nov 03 '16 at 11:55

1 Answers1

0

OInherting Kanban is regular view and has to be inherited like regular views inheritance and this link is the example of the Kanban view inheritance. Kanban view contain qweb but its not actual qWeb template so follow view inheritance document here

ifixthat
  • 6,137
  • 5
  • 25
  • 42
  • Thank you for your reply. The links you have provided really show how to edit a template within a regular view. However, I want to edit a real template defined in different module `addons/web_kanban/static/xml/web_kanban.xml`. It is an xml with following structure: ``. I cannot use the above mentioned approach as I cannot refer to the entities defined outside the view (I tried anyway, just to see what happens) – Juraj Bezručka Nov 03 '16 at 11:01