From e37db6412aa4ca85c8ad1635c49e9150a202f5af 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 ba649532..4fde71c4 100644 --- a/web_m2x_options/static/src/js/form.js +++ b/web_m2x_options/static/src/js/form.js @@ -217,7 +217,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)) { @@ -239,7 +239,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 () {