From 544a25c1acdb82a0eeabec6ba4057772b7961920 Mon Sep 17 00:00:00 2001 From: jesusVMayor Date: Tue, 30 May 2017 16:18:24 +0200 Subject: [PATCH] web_m2x_options: Hide the create/create and edit... button when the user does not have creation permission. --- web_m2x_options/static/src/js/form.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web_m2x_options/static/src/js/form.js b/web_m2x_options/static/src/js/form.js index fb46f274..e3cc0b5e 100644 --- a/web_m2x_options/static/src/js/form.js +++ b/web_m2x_options/static/src/js/form.js @@ -215,7 +215,7 @@ odoo.define('web_m2x_options.web_m2x_options', function (require) { m2x_create_undef = _.isUndefined(self.view.ir_options['web_m2x_options.create']), m2x_create = self.is_option_set(self.view.ir_options['web_m2x_options.create']); var show_create = (!self.options && (m2x_create_undef || m2x_create)) || (self.options && (quick_create || (quick_create_undef && (m2x_create_undef || m2x_create)))); - if (show_create){ + if (self.can_create && show_create){ if (search_val.length > 0 && !_.include(raw_result, search_val)) { @@ -237,7 +237,7 @@ odoo.define('web_m2x_options.web_m2x_options', function (require) { m2x_create_edit_undef = _.isUndefined(self.view.ir_options['web_m2x_options.create_edit']), m2x_create_edit = self.is_option_set(self.view.ir_options['web_m2x_options.create_edit']); var show_create_edit = (!self.options && (m2x_create_edit_undef || m2x_create_edit)) || (self.options && (create_edit || (create_edit_undef && (m2x_create_edit_undef || m2x_create_edit)))); - if (show_create_edit){ + if (self.can_create && show_create_edit){ values.push({ label: _t("Create and Edit..."), action: function () {