Browse Source

[IMP][mis_builder] Check if current user is in accountant group to show setings button

pull/189/head
Adrien Peiffer (ACSONE) 9 years ago
committed by Stéphane Bidoul
parent
commit
f6fd1c88f4
  1. 6
      mis_builder/static/src/js/mis_builder.js
  2. 2
      mis_builder/static/src/xml/mis_widget.xml

6
mis_builder/static/src/js/mis_builder.js

@ -94,6 +94,12 @@ var MisReport = form_common.FormWidget.extend({
self.$(".oe_mis_builder_print").click(_.bind(this.print, this));
self.$(".oe_mis_builder_export").click(_.bind(this.export_pdf, this));
self.$(".oe_mis_builder_settings").click(_.bind(this.display_settings, this));
var Users = new instance.web.Model('res.users');
Users.call('has_group', ['account.group_account_user']).done(function (res) {
if (res) {
self.$(".oe_mis_builder_settings").show();
}
});
},
events: {
"click a.mis_builder_drilldown": "drilldown",

2
mis_builder/static/src/xml/mis_widget.xml

@ -4,7 +4,7 @@
<div class="oe_mis_builder_buttons oe_right">
<button class="oe_mis_builder_print"><img src="/web/static/src/img/icons/gtk-print.png"/> Print</button>
<button class="oe_mis_builder_export"><img src="/web/static/src/img/icons/gtk-go-down.png"/>Export</button>
<button class="oe_mis_builder_settings"><img src="/web/static/src/img/icons/gtk-execute.png"/> Settings</button>
<button style="display: none;" class="oe_mis_builder_settings"><img src="/web/static/src/img/icons/gtk-execute.png"/> Settings</button>
</div>
<table t-if="widget.mis_report_data" class="oe_list_content mis_builder">
<thead>

Loading…
Cancel
Save