Odoo Help

Welcome!

This community 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.

4

Change the format of field Date on form view

By
Isabelle Richard
on 9/3/15, 4:23 AM 5,589 views

Hi,

On a form view, I try to change the format used to display a field Date.
I don't want to change the format of all fields Date, just for one field.

In QWeb, I can use this syntax: 

<span t-field="blog_post.create_date" t-field-options='{"format": "MMMM yyyy"}'/>

Is it possible to do the same thing of form view, without editing date format on lang parameters ?


odoo dosen't have that kind of feature till odoo v8, If you know web customization than develop your own widget which accept the format parameter and display date value based on format passed from the form view.

Anil R. Kesariya
on 9/15/15, 5:14 AM

Thank you, I will try to develop my own Date widget with an option for format.

Isabelle Richard
on 9/15/15, 8:01 AM
3

Ankit H Gandhi(AHG)

--Ankit H Gandhi(AHG)--
996
| 5 3 6
Rajkot, India
--Ankit H Gandhi(AHG)--

Learning Python..

Ankit H Gandhi(AHG)
On 9/13/15, 2:56 AM

Dear Isabelle Richard,

First you need to enable the Technical Features under your user account, then go to

Settings ->Translations -> Languages.

Edit your current language and change the date format

Thanks & Regards

Ankit H Gandhi.

3

You can do that with a widget:

<field name="date_order" widget="date"/>
0

Axel Mendoza

--Axel Mendoza--
10228
| 7 7 8
Camaguey, Cuba
--Axel Mendoza--

DevOps - Full stack - Software Architect - Developer - Technology Integrator

I could help you to develop anything and solve complex problems based on technologies, integrations and tricky stuffs mostly in Python with OpenERP/Odoo, Zato, Django and many others frameworks programming languages and technologies.

I offers consulting services to anyone with an unanswered questions or needs for customizations. Think about it, maybe it's better to have an expert to solve your issues and projects than having a full time employee trying to understand what to do an how

Reach me at aekroft@gmail.com

Axel Mendoza
On 12/23/15, 2:36 AM

Use this module:

https://github.com/OCA/web/tree/8.0/web_widget_datepicker_options

0
Jainik Patel (jaa)
On 12/16/15, 1:36 AM

It seems like o.date_order it's not a datetime object but a string. Using the time module is the way to go:

<span t-esc="time.strftime('%A, %d %B %Y',time.strptime(o.date_order,'%Y-%m-%d %H:%M:%S'))"/>
 

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

2 follower(s)

Stats

Asked: 9/3/15, 4:23 AM
Seen: 5589 times
Last updated: 2/1/16, 9:46 AM