Odoo Help

2

2
11 الإجابات
22
الصورة الرمزية

Ankit H Gandhi(AHG) الهند

--Ankit H Gandhi(AHG)--

1489
| 6 5 8
Baroda, الهند
--Ankit H Gandhi(AHG)--

Learning Python..

Ankit H Gandhi(AHG) الهند
23‏/1‏/2015 2:12 ص

Hello Cesar Bustios Benites

try this code may be helpfull.

<span t-field="o.date_order" t-field-options='{"format": "d MMMM y"}'/>

also use this code

<span t-field="o.date_order" t-field-options="{&quot;format&quot;: &quot;yyyy-MM-dd&quot;}" />

Update:

I thought that t-field-options could only be applied to t-field.

<span t-field="o.commencement_date"

t-field-options="{&quot;format&quot;: &quot;dd/MM/yy&quot;}"></span

Updated:

<span t-esc="o.order_date" t-options='{"widget": "date"}'/>


if you find this answer helpful, please give me a thumbs up vote

Regards,

Ankit H Gandhi

 

1 تعليق
Dhananjay Patil الهند
24‏/7‏/2019 1:49 ص

<span t-esc="o.order_date" t-options='{"widget": "date"}'/> is correct for version 12 qweb reports it works thanks

5
الصورة الرمزية

Sajin Aziz الإمارات العربية المتحدة

--Sajin Aziz--

818
| 2 2 5
Dubai, الإمارات العربية المتحدة
--Sajin Aziz--
Sajin Aziz الإمارات العربية المتحدة
22‏/11‏/2014 3:50 ص

try this , change date format as required , refer: Python Standard Library - time , 

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

3 التعليقات
César Bustíos Benites البيرو
24‏/11‏/2014 10:10 ص

Thank you @Sajin, I'm getting "Uncaught SyntaxError: Unexpected end of input"

César Bustíos Benites البيرو
24‏/11‏/2014 10:12 ص

Sorry, my bad. This is the correct answer :-)

César Bustíos Benites البيرو
24‏/11‏/2014 10:15 ص

Although I'm using Spanish as my language, I'm getting this: "Surco, 21 de November del 2014". How can I make months show in Spanish?

1
acha aslam الهند
29‏/6‏/2017 2:08 ص

in odoo10

it prints mm-dd-yyyy format of date order

<span t-field="o.date_order" t-options="{&quot;format&quot;: &quot;MM-dd-yyyy&quot;}" />

1
Kelly Stuart الولايات المتّحدة
22‏/11‏/2014 3:09 ص

Hi César. If you are getting an error, please specify what error it is. Otherwise I'm going to assume that your date format is merely incomplete. Try this:

<span t-esc="o.date_order.strftime('%A, %d de %B del %Y')" />

1 تعليق
César Bustíos Benites البيرو
24‏/11‏/2014 10:07 ص

Hello @Kelly, thank you for your answer. Yes I'm getting an error: "Uncaught SyntaxError: Unexpected end of input"

0
Prakash Prajapati (ppr) الهند
1‏/2‏/2017 12:18 ص

model inside default field date

current_date = fields.Date(default=time.strftime("%Y-%m-%d"))

report xml

<span t-field="o.current_date"/>

0
Ubaid ur Rehman باكستان
21‏/6‏/2017 6:02 ص

For date and time display in formate like Jun 20, 2017 11:05 AM in Qweb Report.
"<sapn t-esc="datetime.datetime.strptime(o.create_date, '%Y-%m-%d %H:%M:%S').strftime('%b %d,%Y %H:%M %p')"/>"

0
الصورة الرمزية

Dasadiya Chaitanya الهند

--Dasadiya Chaitanya--
--Dasadiya Chaitanya--

I am passionate and dynamic programmer with simple and honest nature which has better expertise skill and knowledge on product development from the scratch. I am enthusiastic with the work and I would like to spend my valuable time to improve my qualitative work standard and developing carrier towards the hobbies of programming. I love my family, friends and some creative and analytical task, And I would like to spend my whole time with them.

Connect With Me :

Linked In ||  Facebook  ||  Twitter 

Skype : dasadiya.chaitanya

Dasadiya Chaitanya الهند
20‏/2‏/2015 8:23 ص
اطرح سؤالاً
Keep Informed
2 متابعين
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.

Register
Odoo Training Center

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

Test it now