Odoo Help



| 8 8 8

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

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

Question tools

1 follower(s)


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