6
A
回答
6
以下是显示如何在OpenERP中开发看板视图的示例代码。
对于看板视图,您必须准备2个文件:(1)xml文件和(2)css文件。 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>
1
我看不到它的任何文档,所以最好的办法是在插件项目中查找示例。搜索所有的XML文件<kanban>
。下面是来自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>
2
他们是文档此,看板观点是基于QWEB技术创建的,通过自身的发展,可以看到整个的lib QWEB lib,并在文件节中,你可以看到您可以定义qWeb QWEB Template,现在,如果你了解它,然后你只需要做的就是出在视图声明,而其他精业公司是一样的通用视图声明标记下您的网页模板:
<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>
希望这将帮你。
问候
-2
只需在XML文件更新这个模型=“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帮助你如何创建看板视图。我希望它能帮助你...
相关问题
- 1. 如何在openerp的看板视图中调用onchange函数?
- 2. openerp cutomer树视图
- 3. Odoo10的看板视图中的空组
- 4. 看板视图中的链接
- 5. 使看板看不见重叠视图
- 6. openerp搜索视图隐藏
- 7. 如何在Odoo/Openerp中查看Qweb模板的最终版本
- 8. 无效XML的视图结构 - OpenERP的
- 9. OpenERP的7无法呈现视图
- 10. 编辑查看模板剃刀视图
- 11. OpenERP 6中'图表'视图的用途是什么?
- 12. 在openerp中展开帐户视图的图表?
- 13. Openerp在图形视图中创建2个条形图
- 14. 看板视图中的货币符号odoo 8
- 15. 视图在列表视图中查看
- 16. 在列表视图中显示图像 - OpenERP Web客户端
- 17. 的OpenERP XPath中引用的页面在父视图
- 18. 修改Web客户端中的OpenERP 6.1产品表单视图
- 19. Odoo 8(Openerp):使用列表视图中的向导设置值
- 20. TypeError:返回视图时,openerp中的this.views_src [0]未定义?
- 21. 是否可以在openerp中自动刷新树视图?
- 22. 立即在openerp one2many列表中使用表单和树视图
- 23. 在XML视图中隐藏“分隔符” - OpenErp
- 24. 如何访问看板视图odoo 0.8上的one2many字段值?
- 25. 如何模拟stock.picking.type看板视图的行为?
- 26. 在看板视图上访问one2many字段的值odoo
- 27. Openerp - 如何继承视图并保留原始图像?
- 28. 无效的XML视图结构问题 - OpenERP的
- 29. 在基于视图的表视图中查看基于表的视图
- 30. 如何在视图板中将视图添加到ViewController的主视图中?