Odoo Help


5 Answers

Odoo Tools Russian Federation

--Odoo Tools--
| 6 3 9
St Petersburg, Russian Federation
--Odoo Tools--

OdooTools is the team of developers and business analysts to help you extend Odoo potential. We have been communicating with end users to whom the software became the main business tool since 2012. As a result, we are proud of dozens of successful Odoo apps developed. We are open for new ideas and challenges to create the best Odoo tools for business needs all over the world.

The apps you may like to implement in your Odoo

KnowSystem - the tool to build deep and structured knowledge base for internal and external use

OwnCloud / NextCloud Odoo Integration - the tool to automatically synchronize Odoo attachments with OwnCloud / NextCloud files in both ways

Joint Calendar - the tool to combine different Odoo events in a few configurable calendars

Google Drive Odoo Integration - the tool to automatically synchronize Odoo attachments with Google Drive files in both ways

Product Management Interface - the tool to search, select and update product templates in batch

OneDrive / SharePoint Odoo Integration - the tool to automatically synchronize Odoo attachments with OneDrive files in both ways

Periodic Reporting and Reminders - the tool to generate and periodically send reports and reminders

--> More apps
Odoo Tools Russian Federation
9/16/19, 12:27 PM

Okay, it seems that is because of default: date is kept with time zone in the database (not UTC).

I guess the simplest way to replace timezone is to re-calculate date in Python (or alternative apply fields_utils in Javascript). Something like (not tested):

def _compute_no_tz_date(self):
for record in self:
record.no_tz_date = fields.Date.to_string(record.date_deadline.date())
# perhaps also better to apply time zone transformation
# have a look at the method _compute_state_from_date in the same file
no_tz_date = fields.Date(compute=_compute_no_tz_date)

Then, this no_tz_date should be shown in XML just as a string without time or time zone

Benjamin Cherpas France
9/16/19, 10:51 AM

It has no effect (see updated answer) I don't understand why...


date_deadline field in MailActivity object (in mail_activity.py file):

date_deadline = fields.Date('Due Date', index=True, required=True, default=fields.Date.context_today)

Log declaration (I don't know if it is declared in some JS file or not):

<li t-if="!_.isEmpty(records)">
<ul class="nav o_activity_log">
<t t-foreach="_.keys(records)" t-as="key">
<t t-set="logs" t-value="records[key]" />
<li class="o_activity_label">
<strong t-attf-class="o_activity_color_#{key}">
<t t-esc="selection[key]" /> (<t t-esc="logs.length"/>)
<li t-foreach="logs" t-as="log" t-att-data-activity-id="log.id" class="o_schedule_activity">
<div class="o_activity_title pull-left">
<span t-attf-class="fa #{log.icon} fa-fw" />
<t t-esc="log.title_action or log.activity_type_id[1]" />
<span class="fa fa-clock-o fa-fw" />
<span t-att-title="log.date_deadline"><t t-esc="log.label_delay" /></span>
<t t-if="log.user_id[0] != uid">
<span class="ml4 fa fa-user" />
<span><t t-esc="log.user_id[1]" /></span>
<div class="pull-right">
<span class="o_mark_as_done o_activity_link o_activity_link_kanban fa fa-check-circle fa-2x mt4" t-att-data-activity-id="log.id" title="Mark as done" />

Thank you for help !

Odoo Tools Russian Federation
9/16/19, 11:05 AM

Share then the field date_deadline Python declaration or Javascript code (depending on what is log - Odoo class or Javascript object).

Benjamin Cherpas France
9/16/19, 11:29 AM

Done. Thanks !

Benjamin Cherpas France
9/17/19, 3:40 AM

Thank you so much it works ! But I used from_string instead of to_string (sorry I can't reply your comment above, just mine). You have been helpful so I'm disappointed to not have enough karma to upvote your answer. Thaaaanks again !!!

Odoo Tools Russian Federation
9/17/19, 6:37 AM

You are welcome. As for karma: I upvoted your question - the situation is quite interesing. Besides, if you need karma in the Future, you can pass a few learning courses - https://www.odoo.com/slides/all

Benjamin Cherpas France
9/17/19, 9:56 AM

Oh nice! I'll think about that! Thanks a lot!


Ask a Question
Keep Informed
2 follower(s)
About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now