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.

4

Can we create a kunban view for a custom module [Closed]

By
Atchuthan
on 5/20/13, 3:58 AM 4,719 views

The Question has been closed

by
Atchuthan
on 06/11/2013 07:20:01
  When browsing for 'How to create custom module in OpenERP 7', I stumbled upon this question as to how I can create a kunban view for my custom module.

  In all sites regarding custom module creation, they discussed about 'form' and 'tree' views only.

Yes can create kanban view for custom module take an example from default openerp product module. product --> product_view.xml "product kanban view" source code.

Prakash
on 5/20/13, 4:04 AM
       <record model="ir.ui.view" id="tryme_kanban_view">
        <field name="name">tryme.kanban</field>
        <field name="model">tryme</field>
        <field name="type">kanban</field>
        <field name="arch" type="xml">
            <kanban>
                #field declaratoin
                #template definition
            </kanban>
        </field>
    </record>
Atchuthan
on 5/20/13, 4:50 AM
6

Sandeep

--Sandeep--
6083
| 6 5 8
Delhi, India
--Sandeep--
Python OpenERP Developer http://in.linkedin.com/pub/sandeep-rana/3b/a16/786/
Sandeep
On 5/20/13, 4:48 AM

Hi atchuthan

Of course you can create Kanban view below an example

    <record model="ir.ui.view" id="My_kanban">
        <field name="name">Kanban</field>
        <field name="model">my.module</field>
        <field name="arch" type="xml">
            <kanban>
                <field name="name"/>
                <field name="code"/>
                <field name="lst_price"/>
                <templates>
                    <t t-name="kanban-box">
                        <div class="oe_kanban_vignette oe_semantic_html_override">
                            <a type="open"><img t-att-src="kanban_image('my.module', 'image_small', record.id.value)" class="oe_kanban_image"/></a>
                            <div class="oe_kanban_details">
                                <h4>
                                    <a type="open">
                                         <t t-if="record.code.raw_value">[<field name="code"/>]</t> <field name="name"/>
                                    </a>
                                </h4>
                                <div name="tags"/>
                                <ul>
                                    <li>Price: <field name="lst_price"></field></li>
                                </ul>
                            </div>
                        </div>
                    </t>
                </templates>
            </kanban>
        </field>
    </record>

Thanks

can you please explain

<img t-att-src="kanban_image('my.module', 'image_small', record.id.value)" class="oe_kanban_image"/>

Atchuthan
on 5/20/13, 5:38 AM

ther should be image field , if you want show image ,, that's name is image_small if you don't have just remove this &lt;a type="open"&gt;&lt;img t-att-src="kanban_image('my.module', 'image_small', record.id.value)" class="oe_kanban_image"/&gt;&lt;/a&gt;

Sandeep
on 5/20/13, 5:41 AM

if for example i have a binary field 'image' in my module 'test', give me the syntax and also what does "record.id.value" signify

Atchuthan
on 5/20/13, 7:00 AM

change the image_small to image and add also this field in above like &lt;field name="code"/&gt; ....record.id.value will get value of image field

Sandeep
on 5/20/13, 7:01 AM

K i got your idea and its working fine

Atchuthan
on 5/20/13, 7:38 AM

ok , good luck

Sandeep
on 5/20/13, 7:47 AM
3

Serpent Consulting Services Pvt. Ltd.

--Serpent Consulting Services Pvt. Ltd.--
4341
| 6 6 8
Gandhinagar, India
--Serpent Consulting Services Pvt. Ltd.--

Serpent Consulting Services Pvt. Ltd. Your Odoo/OpenERP Solution, just an email away!

Serpent Consulting Services Pvt. Ltd.
On 5/20/13, 4:54 AM

Hello,

Yes, you can create a kanban view for a custom module

-This is my simple example of kanban view.

<!-- Product Kanban View  -->

    <record model="ir.ui.view" id="product.product_kanban_view">
        <field name="name">Product Kanban</field>
        <field name="model">product.product</field>
        <field name="arch" type="xml">
            <kanban>
                <field name="color"/>
                <field name="type"/>
                <field name="image_small"/>
                <field name="list_price"/>
                <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">
                                         <t t-if="record.code.raw_value">[<field name="code"/>]</t> <field name="name"/>
                                    </a>
                                </h4>
                                <div name="tags"/>
                                <ul>
                                    <li>Price: <field name="lst_price"></field></li>
                                </ul>
                            </div>
                        </div>
                    </t>
                </templates>
            </kanban>
        </field>
    </record>

About This Community

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

Question tools

2 follower(s)

Stats

Asked: 5/20/13, 3:58 AM
Seen: 4719 times
Last updated: 6/10/16, 3:32 AM