Skip to content

Conversation

@GillesTephaneMeyomesse
Copy link

No description provided.

@oca-clabot
Copy link

Hey @GillesTephaneMeyomesse, thank you for your Pull Request.

It looks like some users haven't signed our Contributor License Agreement, yet.
You can read and sign our full Contributor License Agreement here: http://odoo-community.org/page/website.cla
Here is a list of the users:

Appreciation of efforts,
OCA CLAbot

@pedrobaeza
Copy link
Member

Welcome to OCA, Gilles! Does Acsone an ECLA (Entity CLA) signed or are they individual?

@pedrobaeza
Copy link
Member

Looking at the module, maybe its functionality is duplicated with datetime_formatter. Have you tried it? Anyway, this module should go better to OCA/reporting-engine I think.

@pedrobaeza pedrobaeza mentioned this pull request Jan 16, 2017
59 tasks
@lmignon
Copy link
Contributor

lmignon commented Jan 16, 2017

@pedrobaeza IMO this functionality is not provided by datetime_formatter This module adds a new qweb expression to get a 'datetime.now' value formatted according to an expected format. MOREOVER the datetime value is rendered by taking care of the user timezone.

@pedrobaeza
Copy link
Member

OK, no problem. How do you see to move the module to OCA/reporting-engine with the name report_qweb_usertime? This repo is quite crowded and the goal is very closed to the other repo.

@lmignon
Copy link
Contributor

lmignon commented Jan 16, 2017

@pedrobaeza The module can be used everywhere where QWEB is used. (website, report, ...). Therefore OCA/reporting-engine is not the right place for this module and the name should be preserved.

@pedrobaeza
Copy link
Member

OK, but AFAIK, Odoo web client already handles user tz in datetime fields. I don't get the user case, but I'm not going to block this anymore because you are going to really hate me 👅

@lmignon
Copy link
Contributor

lmignon commented Jan 16, 2017

@pedrobaeza If you put datetime.now() into a qweb t-esc element , the tz will not be taken into account because the result of datetime.now on the server is UTC. But when you add a t-field in a report or a webpage, the qweb template engine will automatically take into account the locale... https://github.com/odoo/odoo/blob/10.0/odoo/addons/base/ir/ir_qweb/fields.py#L192

@lmignon
Copy link
Contributor

lmignon commented Jan 16, 2017

@pedrobaeza I'll recheck if we can find a 'standard way' to correctly display datetime.now in a report...

@pedrobaeza
Copy link
Member

Thanks for the explanation. I get the user case: the typical "printing time" in the footer. I'm going also to investigate if there's a standard way of doing that as well.

@GillesTephaneMeyomesse
Copy link
Author

@pedrobaeza After some more investigations and a retry of an unsuccessful attempt, we finally found the standard way to do it without an additional module :

 <t t-esc="context_timestamp(datetime.datetime.now()).strftime('%H:%M:%S')"/>

Therefore we close this PR

@pedrobaeza
Copy link
Member

Cool that you found it! Then I remove the module from the repo and put the explanation in the migration issue.

pedrobaeza added a commit that referenced this pull request Jan 16, 2017
As stated in #700 (comment),
you can put `<t t-esc="context_timestamp(datetime.datetime.now()).strftime('%H:%M:%S')"/>`
for achieving the same result.
@oca-clabot
Copy link

Hey @GillesTephaneMeyomesse,
We acknowledge that the following users have signed our Contributor License Agreement:

Appreciation of efforts,
OCA CLAbot

SiesslPhillip pushed a commit to grueneerde/OCA-server-tools that referenced this pull request Nov 20, 2024
Syncing from upstream OCA/server-tools (14.0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants