summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Kersten <jke@odoo.com>2014-10-10 16:20:10 +0200
committerJeremy Kersten <jke@odoo.com>2014-10-10 16:20:10 +0200
commitfc47823ab2a8ede8f7cab8590d4790eff7f6aa0d (patch)
tree64be6e848d941924a47cd0b97f532073e8b582ba
parentb576de5f0592d614f013f462cd6218a3a7d44b03 (diff)
[IMP] ir_qweb: remove the option 'only_date' introducted in cefc9ad8e3e3b0a14804da6c40bfd71e16d4175a. Now we can use widget='date' to do the same thing. That keeps the same behaviour that in the backend.
<span t-field=model.datetime_field t-field-options="{'widget': 'date'}"/>
-rw-r--r--openerp/addons/base/ir/ir_qweb.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/openerp/addons/base/ir/ir_qweb.py b/openerp/addons/base/ir/ir_qweb.py
index 9c90cf43bfa..6a54e6f039c 100644
--- a/openerp/addons/base/ir/ir_qweb.py
+++ b/openerp/addons/base/ir/ir_qweb.py
@@ -675,13 +675,13 @@ class DateConverter(osv.AbstractModel):
_inherit = 'ir.qweb.field'
def value_to_html(self, cr, uid, value, column, options=None, context=None):
- if not value: return ''
+ if not value or len(value)<10: return ''
lang = self.user_lang(cr, uid, context=context)
locale = babel.Locale.parse(lang.code)
if isinstance(value, basestring):
value = datetime.datetime.strptime(
- value, openerp.tools.DEFAULT_SERVER_DATE_FORMAT)
+ value[:10], openerp.tools.DEFAULT_SERVER_DATE_FORMAT)
if options and 'format' in options:
pattern = options['format']
@@ -711,10 +711,7 @@ class DateTimeConverter(osv.AbstractModel):
if options and 'format' in options:
pattern = options['format']
else:
- if options and options.get('only_date') and options.get('only_date') in ["True", 'true']:
- strftime_pattern = (u"%s" % (lang.date_format))
- else:
- strftime_pattern = (u"%s %s" % (lang.date_format, lang.time_format))
+ strftime_pattern = (u"%s %s" % (lang.date_format, lang.time_format))
pattern = openerp.tools.posix_to_ldml(strftime_pattern, locale=locale)
if options and options.get('hide_seconds'):