From 5149e18ec704df151c03d3b1e35d5f04328b89d3 Mon Sep 17 00:00:00 2001 From: Khoi Nguyen Date: Tue, 29 Aug 2017 10:59:25 +0200 Subject: [FIX] web: always display handle widget Before this commit, a list containing a handle widget would only display the handles associated with non-zero integer values. This is due to the fact that unset fields are hidden in Odoo, while a field is by default considered 'defined' if its value is truthy. We override the isSet method for the handle widget to always return true. This tells the handle widget that the associated integer value is always defined, thereby ensuring that the handle will always be shown. --- addons/web/static/src/js/fields/basic_fields.js | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'addons/web/static/src/js/fields/basic_fields.js') diff --git a/addons/web/static/src/js/fields/basic_fields.js b/addons/web/static/src/js/fields/basic_fields.js index 6343fb7e80e..d9482156745 100644 --- a/addons/web/static/src/js/fields/basic_fields.js +++ b/addons/web/static/src/js/fields/basic_fields.js @@ -846,6 +846,13 @@ var HandleWidget = AbstractField.extend({ tagName: 'span', description: "", supportedFieldTypes: ['integer'], + + /* + * @override + */ + isSet: function () { + return true; + }, }); var FieldEmail = InputField.extend({ -- cgit v1.2.3