[FIX] web: fix statusbar option conversion

Issue

	- Install Projects
	- All Tasks > Form View
	- Edit the view
	- Set statusbar clickable to '0'

	Still clickable

Cause

	In relational_field.js we do
	`!!'0'` which returns true
	like `!!'anythingelse'`

Solution

	Add a '+' which will convert
	the value into an integer
	for a better conversion.

OPW-2235311

closes odoo/odoo#51083

X-original-commit: 53cc68fce32f46a0b4bc83a1e73a5d13a60fc995
Signed-off-by: Jason Van Malder (jvm) <jvm@odoo.com>
This commit is contained in:
jvm-odoo
2020-05-12 08:28:27 +00:00
parent e3c303e6cb
commit 3a11b9e757
2 changed files with 6 additions and 2 deletions
@@ -2767,7 +2767,11 @@ var FieldStatus = AbstractField.extend({
// Retro-compatibility: clickable used to be defined in the field attrs
// instead of options.
// If not set, the statusbar is not clickable.
this.isClickable = !!this.attrs.clickable || !!this.nodeOptions.clickable;
try {
this.isClickable = !!JSON.parse(this.attrs.clickable);
} catch (_) {
this.isClickable = !!this.nodeOptions.clickable;
}
},
//--------------------------------------------------------------------------
+1 -1
View File
@@ -6868,7 +6868,7 @@ QUnit.module('Views', {
model: 'partner',
data: this.data,
arch: '<form>' +
'<header><field name="trululu" widget="statusbar" clickable="True"/></header>' +
'<header><field name="trululu" widget="statusbar" clickable="true"/></header>' +
'</form>',
res_id: 1,
mockRPC: function (route, args) {