[FIX] Small fixes
authorRichard Mathot (OpenERP) <rim@openerp.com>
Mon, 16 Dec 2013 16:09:08 +0000 (17:09 +0100)
committerRichard Mathot (OpenERP) <rim@openerp.com>
Mon, 16 Dec 2013 16:09:08 +0000 (17:09 +0100)
bzr revid: rim@openerp.com-20131216160908-yx5deeleg0m57n5s

addons/survey/controllers/main.py
addons/survey/static/src/js/survey.js
addons/survey/views/survey_templates.xml

index 6da5e8e..6419a67 100644 (file)
@@ -202,7 +202,7 @@ class WebsiteSurvey(http.Controller):
                 elif answer.answer_type == 'text':
                     answer_value = answer.value_text
                 elif answer.answer_type == 'number':
-                    answer_value = answer.value_number
+                    answer_value = answer.value_number.__str__()
                 elif answer.answer_type == 'date':
                     answer_value = answer.value_date
                 # TODO mettre les QCM ici
index 376dfde..375a7c9 100644 (file)
@@ -64,7 +64,6 @@ $(document).ready(function () {
     function prefill(){
         var prefill_def = $.ajax(prefill_controller, {dataType: "json"})
             .done(function(json_data){
-                console.log(json_data)
                 _.each(json_data, function(value, key){
                     the_form.find(".form-control[name=" + key + "]").val(value);
                 });
@@ -72,6 +71,7 @@ $(document).ready(function () {
             .fail(function(){
                 console.warn("[survey] Unable to load prefill data");
             });
+        return prefill_def;
     };
 
     // function validate(form){
@@ -116,5 +116,6 @@ $(document).ready(function () {
 
     console.debug("[survey] Custom JS for survey loaded!");
 
+    // Launch prefilling
     prefill();
 });
index 7ad7195..5bd1c1f 100644 (file)
     </template>
 
     <template id="numerical_box" name="Numerical box">
-        <input type="number" class="form-control" t-att-name="prefix"/>
+        <input type="number" step="any" class="form-control" t-att-name="prefix"/>
     </template>
 
     <template id="datetime" name="Datetime box">