Kanban in OpenERP

How to create a kanban view in OpenERP?

The developers book does not seem to contain any information on the new Kanban view, and I have not seen anything useful in the OpenERP forum .

+6
source share
4 answers

Here is a sample code showing how to develop a kanban representation in OpenERP.

To represent kanban, you need to prepare 2 files: (1) xml file and (2) css file. A CSS file is used to form a kanban representation.

<record model="ir.ui.view" id="resource_kanban_view"> <field name="name">any name of ur model</field> <field name="model">object.name</field> <field name="type">kanban</field> <field name="arch" type="xml"> <kanban> <templates> <t t-name="kanban-box"> <div class="oe_resource_vignette"> <div class="oe_resource_image"> <a type="edit"><img t-att-src="kanban_image('object.name', 'photo', record.id.value)" class="oe_resource_picture"/></a> </div> <div class="oe_resource_details"> <ul> <!--Here you have to write the object field name which you want to display in kanban view --> <li><field name="name"/></li> <li><field name="author"/></li> <li><field name="description"/></li> <li><field name="available_copy"/> </li> </ul> </div> </div> </t> </templates> </kanban> </field> </record> 
+6
source

Their Doc on this, the KANBAN view is created on the basis of QWEB technology developed by itself, you can see the whole QWEB lib lib and in the Doc section you can see how you can define qWeb QWEB Template . Now, if you understand this, you just need everything you need to do your web template under the tag in the view declaration, where the other systex are the same as the general view declaration:

  <record model="ir.ui.view" id="view_external_id"> <field name="name">View Name</field> <field name="model">openerp.modelfield> <field name="type">kanban</field> <field name="arch" type="xml"> <kanban> <field name="color"/> <!--list of field to be loaded --> <field name="list_price"/> <templates> <!--Your Qweb based template goes here, each record will be wrapped in template so you can arrange field veyr easily in box --> </templates> </kanban> </field> </record> 

Hope this helps you.

Hi

+2
source

I don't see any documentation yet, so it's best to look for examples in the addons project. Find all the XML files for <kanban> . Here is an example from the stock module :

  <record model="ir.ui.view" id="product.product_kanban_view"> <field name="name">Product Kanban</field> <field name="model">product.product</field> <field name="type">kanban</field> <field name="arch" type="xml"> <kanban> <field name="color"/> <field name="type"/> <field name="product_image"/> <field name="list_price"/> <templates> <t t-name="kanban-box"> <div class="oe_product_vignette"> <div class="oe_product_img"> <a type="edit"><img t-att-src="kanban_image('product.product', 'product_image', record.id.value)" class="oe_product_photo"/></a> </div> <div class="oe_product_desc"> <h4><a type="edit"><field name="name"></field></a></h4> <ul> <li t-if="record.type.raw_value != 'service'">Stock on hand: <field name="qty_available"/> <field name="uom_id"/></li> <li t-if="record.type.raw_value != 'service'">Stock available: <field name="virtual_available"/> <field name="uom_id"/></li> <li>Price: <field name="lst_price"></field></li> <li>Cost: <field name="standard_price"></field></li> </ul> </div> </div> <script> $('.oe_product_photo').load(function() { if($(this).width() > $(this).height()) { $(this).addClass('oe_product_photo_wide') } }); </script> <div></div> </t> </templates> </kanban> </field> </record> 
+1
source

Just in the xml file update this model = "ir.actions.act_window" with view_mode, for example:

  <record id="action_id" model="ir.actions.act_window"> <field name="name">Name1</field> <field name="type">ir.actions.act_window</field> <field name="res_model">model_name</field> <field name="view_type">form</field> <field name="view_mode">kanban,tree,form,calendar,graph,gantt</field> ..... </record> 

This is the way to invoke the whole view, and the link http://www.slideshare.net/openobject/openerp-61-framework-changes will help you how to create a kanban view. Hope this helps you ...

-2
source

Source: https://habr.com/ru/post/912357/


All Articles