Reputation: 1168
When I'm clicking on button then wizard open in 'edit' mode. I want to open wizard in 'save' mode also want to hide button footer(create, edit, save & discard). So, Anyone suggests me the solution for this problem?
My code is below:
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();}})
});
Also attaching Screenshot:
Thanks in advance
Upvotes: 1
Views: 893
Reputation: 1168
Problem solved by applying flags in action and hide button by 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>
Thanks to all.
Upvotes: 1