当我单击按钮时,向导将以“编辑”模式打开。我想以“保存”模式打开向导,也想隐藏按钮页脚(创建,编辑,保存和丢弃)。那么,有人建议我解决这个问题吗?
我的代码如下:
o_button_help: function(){
var self = this;
event.stopPropagation();
event.preventDefault();
rpc.query({
model: 'timesheet.help',
method: 'get_timesheet_help_document',
args: [],
}).then(function (res) {
test = res['timesheet_document_view_id'];
self.do_action({
name: ("Help"),
type: 'ir.actions.act_window',
res_model: 'document.document',
view_mode: 'form,tree,kanban',
view_type: 'form',
views: [[false, 'form'],[false, 'list'],[false, 'kanban']],
target: 'new',
res_id: test,
},{on_reverse_breadcrumb: function(){ return self.reload();}})
});
答案 0 :(得分:1)
通过在操作中应用标志并通过jquery隐藏按钮来解决问题:
o_button_help: function(){
var self = this;
event.stopPropagation();
event.preventDefault();
rpc.query({
model: 'timesheet.help',
method: 'get_timesheet_help_document',
args: [],
}).then(function (res) {
test = res['timesheet_document_view_id'];
self.do_action({
name: ("Help"),
type: 'ir.actions.act_window',
res_model: 'document.document',
view_mode: 'form,tree,kanban',
view_type: 'form',
views: [[false, 'form'],[false, 'list'],[false, 'kanban']],
target: 'new',
res_id: test,
flags: {'form': {'mode': 'readonly', 'initial_mode': 'readonly'}},
},{on_reverse_breadcrumb: function(){ return self.reload();}})
});
<form class="o_form_document">
<script>
$(document).ready(function(){
$(".modal-header").hide();
$(".modal-footer").hide();
});
</script>
...
</form>
感谢所有人。