按装xodoo模块
前台 <button name='button_workflow' string='审批' type='object' class='oe_highlight'/>
<record id="tree_product_product_device" model="ir.ui.view">
<field name="name">product.product.tree</field>
<field name="model">product.product</field>
<field name="priority">-1</field>
<field name="arch" type="xml">
<tree string="列表">
<field name="image_1920" widget="image" class="o_image_24_cover"/>
<field name="name" string="设备名称"/>
<field name="manufacturer_id"/>
<field name="specification" string="设备型号"/>
<field name="vessel_ids" widget="many2many_tags" options="{'color_field': 'color'}"/>
<field name="tag_ids" widget="many2many_tags" string="设备标签" options="{'color_field': 'color'}"/>
<field name="description" string="备注"/>
<field name="categ_id" string="目录路径"/>
<button name='button_workflow' string='审批' type='object' class='oe_highlight'/>
</tree>
</field>
</record>
后台:
def button_workflow(self):
url = '/web/login'
open = {}
open['type'] = 2 #可缺省 默认值为2 基本层类型:0(信息框,默认)1(页面层)2(iframe层,也就是解析content)3(加载层)4(tips层)
open['title'] = "登陆" #可缺省 默认值为 空 窗口标题
open['area'] = ['1000px', '680px'] #窗口大小
open['btn'] = ['确认'] #可缺省 按钮:按钮1的回调是yes(也可以是btn1),而从按钮2开始,则回调为btn2: function(){},以此类推
return {
'name': '登陆',
'type': 'ir.actions.act_url',
'url': url,
'target': 'open_iframe',
'open': open,
}
扩展
else if(action.target === "open_iframe"){ }
效果