vuvivian's blog

越努力,越幸运.

  1. 1. tree/form视图设置自定义按钮
  2. 2. 是否显示默认按钮 hasSidebar
  3. 3. 自定义按钮标签buttonspack
  4. 4. 默认按钮的控制
  5. 5. 按钮分组 buttongroup
  6. 6. 按钮 button
  7. 7. 按钮数据格式

tree/form视图设置自定义按钮

isAdvancedBtn
    * false 默认
    * true

是否显示默认按钮 hasSidebar

hasDefaultBtn
    * true 默认
    * false 

自定义按钮标签buttonspack

1
2
3
4
5
6
7
  <buttonspack>
<button name="abc" type="object" string="提交/批量" isBatch="true"/>
<button name="%(todo_button_action)d" type="object" string="单一/action" isBatch="false"/>
<buttongroup string="分组" isBatch="false">
<button name="%(todo_button_action)d" type="object" string="测试" isBatch="false"/>
</buttongroup>
</buttonspack>

默认按钮的控制

1. 新建  create
2. 复制  copy   
3. 导出全部 exportAll
4. 删除  delete
5. 导出 export_xlsx
6. 导入 import
7. 复制 copy

按钮分组 buttongroup

1
2
1.string: 分组显示
2.isBatch: 是否批量操作

按钮 button

1. type: 类型
        * object 
        * tag
2. isBatch: 是否批量操作
        * false 默认
4. name: 方法名/ir.actions.act_window对应的id
5. string: 显示
6. attrs: 参数

按钮数据格式

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
[
{
"tag":"buttongroup",
"attrs":{
"string":"新建",
"isBatch":"false",
"condition":"readonly",
"accesskey":"createGroup",
"btnId":"advantedBtn_33"
},
"children":[
{
"tag":"button",
"attrs":{
"string":"新建",
"isBatch":"false",
"type":"event",
"accesskey":"create",
"class":"",
"btnId":"advantedBtn_34"
}
},
{
"tag":"button",
"attrs":{
"string":"复制",
"isBatch":"false",
"type":"event",
"accesskey":"copy",
"class":"",
"btnId":"advantedBtn_35"
}
}
]
},
{
"tag":"button",
"attrs":{
"string":"保存",
"isBatch":"false",
"type":"event",
"condition":"edit",
"class":""
}
},
{
"tag":"button",
"attrs":{
"string":"取消",
"isBatch":"false",
"type":"event",
"condition":"edit",
"class":""
}
},
{
"tag":"button",
"attrs":{
"string":"导出全部",
"isBatch":"false",
"type":"event",
"condition":"readonly",
"accesskey":"exportAll",
"btnId":"advantedBtn_36"
}
},
{
"tag":"button",
"attrs":{
"name":"do_toggle_done",
"type":"object",
"string":"前后交互按钮",
"isBatch":"false",
"modifiers":{

},
"options":{

},
"tag":"button",
"btnId":"advantedBtn_37"
},
"children":[

]
},
{
"tag":"button",
"attrs":{
"name":"action_server_forbid",
"type":"object",
"string":"动作",
"isBatch":"false",
"modifiers":{

},
"options":{

},
"tag":"button",
"btnId":"advantedBtn_38"
},
"children":[

]
}
]
本文最后更新于 天前,文中所描述的信息可能已发生改变