[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`.
This commit is contained in:
Raphael Collet
2018-08-23 21:39:16 +02:00
parent 961ccd69c8
commit 7efa669b49
+5 -6
View File
@@ -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('<div id="website_form_editor_success_test_tour_'+model+'"></div>');
}
};