[英]How to open wizard action in save mode also hide edit,create,save & discard button Odoo11
當我單擊按鈕時,向導會以“編輯”模式打開。 我想在“保存”模式下打開向導也想隱藏按鈕頁腳(創建、編輯、保存和丟棄)。 那么,有人建議我解決這個問題嗎?
我的代碼如下:
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();}})
});
通過在操作中應用標志並通過 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>
謝謝大家。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.