Help

Can we create a kunban view for a custom module

Gesloten
Avatar
Atchuthan

De vraag is gesloten

door
Atchuthan
aan 11-06-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.
2 Opmerkingen
Avatar
Negeren
Avatar
Prakash
-

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.

Avatar
Atchuthan
-
       <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>
2 Antwoorden
6
Beste antwoord

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

6 Opmerkingen
Avatar
Negeren
Avatar
Atchuthan
-

can you please explain

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

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;

Avatar
Atchuthan
-

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

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

Avatar
Atchuthan
-

K i got your idea and its working fine

ok , good luck

4

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>
Avatar
Negeren