Odoo Help


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.



| 7 7 8
Turnhout, Belgium

My Odoo blog: http://www.odoo.yenthevg.com/

My Twitter: https://twitter.com/Yenthe666

On 5/11/16, 5:17 AM

Hi Moubou,

Import the correct Python library for date(times) at the top of your Python file:

from datetime import datetime

and then create the field in the model with the date pre-filled:

your_date_field = fields.Date(string='Your string', default=datetime.today())

This will automatically fill in the today's date in the date field.


Working Perfectly Thank you Yenthe

on 5/11/16, 5:55 AM

It actually doesn't matter how, important thing is that it works ;) 1UP-vote for Yanthe

Dr Obx
on 5/11/16, 9:05 AM

I would love to give 1up for Fekete as well but I can't :)

Dr Obx
on 5/11/16, 9:07 AM

@Obx : now you can :-)

Ermin Trevisan
on 5/11/16, 11:05 AM
Fekete Mihai
On 5/11/16, 11:04 AM

Hi Yenthe, isn't is easier to do a default=fields.Date.today(), without any other import...

Agreed that this would be a neat way in order to not use any import. Usually you do need the datetime import for a few things when you've added date fields though. +1 for you!

on 5/12/16, 1:47 AM

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

1 follower(s)


Asked: 5/11/16, 5:08 AM
Seen: 211 times
Last updated: 5/11/16, 11:04 AM