[FIX] report: datetime already imported, differently

This rev. is related to 439cdb6871.

The module datetime was already available in the reports,
and it was the entire datetime module that was imported,
not just the class.

This rev. is not recompatible with 439cdb6871,
but there is no other choice, since other existing
reports might already expected the datetime module
and not the class

opw-640299
This commit is contained in:
Denis Ledoux 2015-05-20 12:16:49 +02:00
parent db3e5716b3
commit 453b373a68
2 changed files with 1 additions and 3 deletions

View File

@ -38,7 +38,6 @@ import lxml.html
import os
import subprocess
from contextlib import closing
from datetime import datetime
from distutils.version import LooseVersion
from functools import partial
from pyPdf import PdfFileWriter, PdfFileReader
@ -143,7 +142,6 @@ class Report(osv.Model):
context = dict(context, translatable=context.get('lang') != request.website.default_lang_code)
values.update(
time=time,
datetime=datetime,
context_timestamp=lambda t: fields.datetime.context_timestamp(cr, uid, t, context),
translate_doc=translate_doc,
editable=True,

View File

@ -123,7 +123,7 @@
<div class="header">
<div class="row">
<div class="col-xs-3">
<span t-esc="context_timestamp(datetime.now()).strftime('%Y-%m-%d %H:%M')"/>
<span t-esc="context_timestamp(datetime.datetime.now()).strftime('%Y-%m-%d %H:%M')"/>
</div>
<div class="col-xs-2 col-xs-offset-2 text-center">
<span t-esc="company.name"/>