From c39fd87d54b9546258624cb7e3f372e4e53abe75 Mon Sep 17 00:00:00 2001
From: Romain Courteaud <romain@nexedi.com>
Date: Wed, 12 Oct 2016 09:24:06 +0000
Subject: [PATCH] [erp5_web_renderjs_ui] Fix getContent for checkbox

---
 .../web_page_module/rjs_gadget_html5_input_js.js            | 6 +++---
 .../web_page_module/rjs_gadget_html5_input_js.xml           | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_html5_input_js.js b/bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_html5_input_js.js
index ae956c2719..1d44228fe7 100644
--- a/bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_html5_input_js.js
+++ b/bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_html5_input_js.js
@@ -71,10 +71,10 @@
         input;
       if (this.state.editable) {
         input = this.element.querySelector('input');
-        if (input.value !== undefined) {
-          result[input.getAttribute('name')] = input.value;
-        } else if (input.checked !== undefined) {
+        if (this.state.type === 'checkbox') {
           result[input.getAttribute('name')] = (input.checked ? 1 : 0);
+        } else {
+          result[input.getAttribute('name')] = input.value;
         }
       }
       return result;
diff --git a/bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_html5_input_js.xml b/bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_html5_input_js.xml
index e00578cdc1..46f440a7e9 100644
--- a/bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_html5_input_js.xml
+++ b/bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_html5_input_js.xml
@@ -230,7 +230,7 @@
             </item>
             <item>
                 <key> <string>serial</string> </key>
-                <value> <string>954.35661.46722.46711</string> </value>
+                <value> <string>954.35694.60208.56524</string> </value>
             </item>
             <item>
                 <key> <string>state</string> </key>
@@ -248,7 +248,7 @@
                     </tuple>
                     <state>
                       <tuple>
-                        <float>1476262019.89</float>
+                        <float>1476264002.68</float>
                         <string>UTC</string>
                       </tuple>
                     </state>
-- 
2.30.9