OpenERPでかんばんビューを作成するにはどうすればよいですか?
開発者向けの本には、新しいかんばんビューに関する情報が含まれていないようです。また、OpenERPフォーラムで役立つ情報は見つかりませんでした。
OpenERPでかんばんビューを作成するにはどうすればよいですか?
開発者向けの本には、新しいかんばんビューに関する情報が含まれていないようです。また、OpenERPフォーラムで役立つ情報は見つかりませんでした。
OpenERPでかんばんビューを作成する方法を示すサンプルコードを次に示します。
かんばんビューの場合、(1)xmlファイルと(2)cssファイルの2つのファイルを準備する必要があります。CSSファイルは、かんばんビューのフォーマットに使用されます。
<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's 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>
彼らはこれに関するDocです。かんばんビューはQWEBテクノロジーに基づいて作成され、OF自体によって開発され、lib QWEB lib全体を見ることができ、Docセクションの下でqWebQWEBテンプレートを定義する方法を見ることができます。次に、必要なのは、ビュー宣言のタグの下にあるWebテンプレートを作成することだけです。ここで、他のsystexは一般的なビュー宣言と同じです。
<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>
これがお役に立てば幸いです。
よろしく
まだドキュメントが表示されていないので、アドオンプロジェクトで例を探すのが最善の方法です。すべてのXMLファイルで。を検索します<kanban>
。これがストックモジュールの例です:
<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>
単にxmlファイルで、このmodel="ir.actions.act_window"を次のようなview_modeで更新します。
<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>
これは、すべてのビューを呼び出す方法です。リンクhttp://www.slideshare.net/openobject/openerp-61-framework-changesは、かんばんビューの作成方法に役立ちます。お役に立てば幸いです...