[MERGE] forward port of branch 7.0 up to revid 4162 launchpad_translations_on_behalf_...
[odoo/odoo.git] / addons / web / static / src / js / formats.js
index 17df1f3..2f6bbce 100644 (file)
@@ -141,7 +141,7 @@ instance.web.format_value = function (value, descriptor, value_if_empty) {
     //noinspection FallthroughInSwitchStatementJS
     switch (value) {
         case '':
-            if (descriptor.type === 'char') {
+            if (descriptor.type === 'char' || descriptor.type === 'text') {
                 return '';
             }
             console.warn('Field', descriptor, 'had an empty string as value, treating as false...');
@@ -196,7 +196,7 @@ instance.web.format_value = function (value, descriptor, value_if_empty) {
                         + ' ' + normalize_format(l10n.time_format));
         case 'date':
             if (typeof(value) == "string")
-                value = instance.web.auto_str_to_date(value);
+                value = instance.web.str_to_date(value.substring(0,10));
             return value.toString(normalize_format(l10n.date_format));
         case 'time':
             if (typeof(value) == "string")