Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

How to have a add stage column in Kanban?

By
Gavin Yap
on 7/22/15, 11:25 AM 1,306 views

I refer to Kanban views whereby I has 2 models

- Stage

- Registration

Stages has One2Many Registrations. 

Registration has Many2One Stage .


and in my kanban view, I can only add Registration, but I cannot add a column (a new Stage)


        <!-- Kanban View -->
<record model="ir.ui.view" id="warranty_registration_kanban_view">
<field name="name">warranty.registration.kanban</field>
<field name="model">warranty.registration</field>
<field name="arch" type="xml">
<kanban default_group_by="stage_id">
<field name="color"/>
<templates>
<t t-name="kanban-box">
<div
t-attf-class="oe_kanban_color_{{kanban_getcolor(record.color.raw_value)}}
oe_semantic_html_override
oe_kanban_card {{record.group_fancy==1 ? 'oe_kanban_card_fancy' : ''}}">
<div class="oe_dropdown_kanban">
<!-- dropdown menu -->
<div class="oe_dropdown_toggle">
<span class="oe_e">#</span>
<ul class="oe_dropdown_menu">
<li>
<a type="delete">Delete</a>
</li>
<li>
<ul class="oe_kanban_colorpicker"
data-field="color"/>
</li>
</ul>
</div>
<div class="oe_clear"></div>
</div>
<div t-attf-class="oe_kanban_content">
<!-- title -->
Start date:
<field name="start_date"/>
<br/>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>


What I want to achieve is like the hr_recruitment  or Notes module,  where I can create stage in the kanban view using the column option

0
Gavin Yap
On 4/17/16, 8:33 AM

The answer is so simple, which I would never thought  of.

In the Kanban view xml, the field used in  'default_group_by', need to be defined within the kanban.

<kanban default_group_by="stage_id">
<field name="stage_id"/>
<field name="project">
    <field name="project_client"/>
    <field name="project_mode"/> 
    <field name="credit"/>
    <field name="state"/>
    <templates>




-1

Drees Far

--Drees Far--
1130
| 5 2 6
Tunis, Tunisia
--Drees Far--
Drees Far
On 7/23/15, 11:28 AM

Here is an example, you can learn from it .


<record id="test_kanban_view" model="ir.ui.view">

<field name="name">Test Kanban</field>

<field name="model">test.project</field>

<field name="arch" type="xml">

<kanban>

<field name="project"/>

<field name="project_client"/>

<field name="project_mode"/> 

<field name="credit"/>

<field name="state"/>

<templates>

<t t-name="kanban-box">

<div class="oe_kanban_vignette oe_semantic_html_override">

<a type="open"><img t-att-src="kanban_image('product.product', 'image_small', record.id.value)" class="oe_kanban_image"/></a>

<div class="oe_kanban_details">

<h4>

<a type="open">

<field name="project"/>

</a>

<div name="client"/>

<ul>

<li>Project Owner:<field name="project_client"></field></li>

</ul>

</h4>

<div name="services"/>

<ul>

<li>Services:<field name="service_ids"></field></li>

</ul>

<div name="credits"/>

<ul>

<li>Credits:<field name="credit_ids"></field></li>

</ul>

</div>

</div>

</t>

</templates>

</kanban>

</field>

</record>

It works in my session perfectly.

Here is a usefull link for you:

https://www.odoo.com/fr_FR/forum/help-1/question/can-we-create-a-kunban-view-for-a-custom-module-17393


Note that service_ids and credit_ids are one2many fields :)

Drees Far
on 7/23/15, 11:30 AM

I think u mis read my question. If you ever install the notes module. in the kanban view of your notes, you can add a column group , or stages. My kanban view works except, I'm not seeing the column option to add a stage.

Gavin Yap
on 7/23/15, 2:39 PM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 7/22/15, 11:25 AM
Seen: 1306 times
Last updated: 4/17/16, 8:33 AM