[IMP] web: use Yes/No instead of True/False for the custom filters

Purpose
=======
"True" and "False" are not very user-friendly, especially for
non-technical people. Instead, we want to have "Yes" or "No" for the
custom filters, when we search on a view, which have more sens for
non-technical people.

Task-2648390

Part-of: odoo/odoo#79911
This commit is contained in:
std-odoo
2022-02-04 09:28:11 +00:00
parent 405c0dcc9c
commit eddef06ad4
4 changed files with 8 additions and 8 deletions
@@ -16,8 +16,8 @@ odoo.define('web.searchUtils', function (require) {
{ symbol: "=", description: _lt("is not set"), value: false },
],
boolean: [
{ symbol: "=", description: _lt("is true"), value: true },
{ symbol: "!=", description: _lt("is false"), value: true },
{ symbol: "=", description: _lt("is Yes"), value: true },
{ symbol: "!=", description: _lt("is No"), value: true },
],
char: [
{ symbol: "ilike", description: _lt("contains") },
@@ -33,8 +33,8 @@ const FIELD_TYPES = {
// FilterMenu parameters
const FIELD_OPERATORS = {
boolean: [
{ symbol: "=", description: _lt("is true"), value: true },
{ symbol: "!=", description: _lt("is false"), value: true },
{ symbol: "=", description: _lt("is Yes"), value: true },
{ symbol: "!=", description: _lt("is No"), value: true },
],
char: [
{ symbol: "ilike", description: _lt("contains") },
@@ -211,7 +211,7 @@ odoo.define('web.filter_menu_generator_tests', function (require) {
const preFilters = args[0];
const preFilter = preFilters[0];
assert.strictEqual(preFilter.type, 'filter');
assert.strictEqual(preFilter.description, 'Boolean Field is true');
assert.strictEqual(preFilter.description, 'Boolean Field is Yes');
assert.strictEqual(preFilter.domain, '[["boolean_field","=",True]]');
}
}
@@ -557,7 +557,7 @@ odoo.define('web.filter_menu_generator_tests', function (require) {
type: "filter",
},
{
description: 'Boolean Field is false',
description: 'Boolean Field is No',
domain: '[["boolean_field","!=",True]]',
type: "filter",
},
@@ -320,7 +320,7 @@ QUnit.module("Search", (hooks) => {
await applyFilter(controlPanel);
assert.deepEqual(getFacetTexts(controlPanel), ["Boolean Field is true"]);
assert.deepEqual(getFacetTexts(controlPanel), ["Boolean Field is Yes"]);
assert.deepEqual(getDomain(controlPanel), [["boolean_field", "=", true]]);
assert.containsOnce(controlPanel, ".o_menu_item");
@@ -672,7 +672,7 @@ QUnit.module("Search", (hooks) => {
assert.deepEqual(getFacetTexts(controlPanel), [
[
'A date is equal to "01/09/1997"',
"Boolean Field is false",
"Boolean Field is No",
'Floaty McFloatface is equal to "7.2"',
'ID is "9"',
].join("or"),