From c39eb41d51f3333aa1e7a8a4ff4737e25484aa05 Mon Sep 17 00:00:00 2001 From: "Adrien Peiffer (ACSONE)" Date: Wed, 16 Mar 2016 08:00:59 +0100 Subject: [PATCH] [IMP][mis_builder] Check if current user is in accountant group to show setings button --- mis_builder/static/src/js/mis_builder.js | 6 ++++++ mis_builder/static/src/xml/mis_widget.xml | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/mis_builder/static/src/js/mis_builder.js b/mis_builder/static/src/js/mis_builder.js index 20a83280..1babe907 100644 --- a/mis_builder/static/src/js/mis_builder.js +++ b/mis_builder/static/src/js/mis_builder.js @@ -83,6 +83,12 @@ openerp.mis_builder = function(instance) { 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", diff --git a/mis_builder/static/src/xml/mis_widget.xml b/mis_builder/static/src/xml/mis_widget.xml index 9d38b704..44c8ec19 100644 --- a/mis_builder/static/src/xml/mis_widget.xml +++ b/mis_builder/static/src/xml/mis_widget.xml @@ -4,7 +4,7 @@
- +