_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']
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'):