From 7efa669b494d55ce0c1cbfa150b3f9fccea24d4f Mon Sep 17 00:00:00 2001 From: Raphael Collet Date: Wed, 22 Aug 2018 10:23:44 +0200 Subject: [PATCH] [FIX] website_form_editor: tour Use `search_count` instead of `search_read` to determine the presence of a mail, because: - reading all fields is not useful; - reading all fields causes access errors for user `admin`. --- static/src/js/website_form_editor_tour.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/static/src/js/website_form_editor_tour.js b/static/src/js/website_form_editor_tour.js index 4f65e63a1be..92211dea263 100644 --- a/static/src/js/website_form_editor_tour.js +++ b/static/src/js/website_form_editor_tour.js @@ -605,18 +605,17 @@ odoo.define('website_form_editor.tour', function(require) { run: function () { var mailDef = rpc.query({ model: 'mail.mail', - method: 'search_read', - domain: [ + method: 'search_count', + args: [[ ['email_to', '=', 'test@test.test'], ['body_html', 'like', 'A useless message'], ['body_html', 'like', 'Service : Development Service'], ['body_html', 'like', 'State : Belgium'], ['body_html', 'like', 'Products : Xperia,Wiko Stairway'] - ], - fields: [], + ]], }); - var success = function(model, data) { - if(data.length) { + var success = function(model, count) { + if (count > 0) { $('body').append('
'); } };