码迷,mamicode.com
首页 > 其他好文 > 详细

Add Customerlize Button in More Button List In Odoo

时间:2014-12-18 20:35:39      阅读:414      评论:0      收藏:0      [点我收藏+]

标签:style   blog   ar   io   color   sp   for   on   div   

There‘re two commen type of actions in odoo: ir.actions.server,ir.actions.client_multi

1.Using ir.actions.server

<record model="ir.actions.server" id="xxxx">
        <field name="name">XXX</field>
        <field name="type">ir.actions.server</field>
        <field name="model_id" ref="model_XXX"/>
        <field name="state">code</field>
        <field name="code">self.do_somthing(cr,uid,ids,context)</field>        
</record>

2.Using ir.actions.act_window

<record model="ir.actions.act_window" id="xxx">
        <field name="name">xxxx</field>
        <field name="res_model">xxx.xxx</field>
        <field name="view_mode">tree,form</field>
        <field name="view_type">form</field>
        <field name="view_id" ref="xxx.xxxxx.xxxx">
        <field name="target">new</field>
<record>

about is two type of ir.actions. the first one you can execute your own python code at the server side using state type "code". the second one you can call an existing action in client side.

3.how to add button in "more" button list

<record model="ir.values" id="xxxx">
        <field name="name"></field>
        <field name="model_id" ref="xxx_xxxx">
        <field name="model">xxxx</field>
        <field name="key">action</field>
        <field name="key2">client_action_multi</field>
        <field name="value" eval="‘ir.actions.act_window,‘+str(ref(‘action_xxx_xx‘))"/>
</record>

 

Add Customerlize Button in More Button List In Odoo

标签:style   blog   ar   io   color   sp   for   on   div   

原文地址:http://www.cnblogs.com/kfx2007/p/4166898.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!