[REM] board: "reset dashboard" button
This commit is contained in:
committed by
Richard Mathot
parent
119b541a0a
commit
b1bd607e71
@@ -9,7 +9,6 @@ if (!instance.board) {
|
||||
|
||||
instance.web.form.DashBoard = instance.web.form.FormWidget.extend({
|
||||
events: {
|
||||
'click .oe_dashboard_link_reset': 'on_reset',
|
||||
'click .oe_dashboard_link_change_layout': 'on_change_layout',
|
||||
'click h2.oe_header span.oe_header_txt': function (ev) {
|
||||
if(ev.target === ev.currentTarget)
|
||||
@@ -78,12 +77,6 @@ instance.web.form.DashBoard = instance.web.form.FormWidget.extend({
|
||||
}
|
||||
});
|
||||
},
|
||||
on_reset: function() {
|
||||
this.rpc('/web/view/undo_custom', {
|
||||
view_id: this.view.fields_view.view_id,
|
||||
reset: true
|
||||
}).done(this.do_reload);
|
||||
},
|
||||
on_change_layout: function() {
|
||||
var self = this;
|
||||
var qdict = {
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
<template>
|
||||
<t t-name="DashBoard">
|
||||
<div class="oe_dashboard_links">
|
||||
<button type="button" class="button oe_dashboard_link_reset" title="Reset Layout.." t-att-style="view.fields_view.custom_view_id || session.debug ? null : 'display: none'">
|
||||
<img src="/board/static/src/img/layout_2-1.png" width="16" height="16"/>
|
||||
<span> Reset </span>
|
||||
</button>
|
||||
<button type="button" class="button oe_dashboard_link_change_layout" title="Change Layout..">
|
||||
<img src="/board/static/src/img/layout_1-1-1.png" width="16" height="16"/>
|
||||
<span> Change Layout </span>
|
||||
|
||||
@@ -1016,19 +1016,6 @@ class View(http.Controller):
|
||||
}, request.context)
|
||||
return {'result': True}
|
||||
|
||||
@http.route('/web/view/undo_custom', type='json', auth="user")
|
||||
def undo_custom(self, view_id, reset=False):
|
||||
CustomView = request.session.model('ir.ui.view.custom')
|
||||
vcustom = CustomView.search([('user_id', '=', request.session.uid), ('ref_id' ,'=', view_id)],
|
||||
0, False, False, request.context)
|
||||
if vcustom:
|
||||
if reset:
|
||||
CustomView.unlink(vcustom, request.context)
|
||||
else:
|
||||
CustomView.unlink([vcustom[0]], request.context)
|
||||
return {'result': True}
|
||||
return {'result': False}
|
||||
|
||||
class TreeView(View):
|
||||
|
||||
@http.route('/web/treeview/action', type='json', auth="user")
|
||||
|
||||
Reference in New Issue
Block a user