Odoo Help

0

How to auto fill datefield with today date?

By
Bonnet Denis
on 7/9/13, 11:57 AM 1,800 views

I want to update the opportunity date deadline field with the current date when the Opportunity is Win.

I overwritten the onchange_stage_id method but I don't know how I can update the field with the current date.

Thanks for help.

2

Grover Menacho

--Grover Menacho--
2573
| 5 7 8
La Paz, Bolivia
--Grover Menacho--

Systems Engineer + MBA

Grover Menacho
On 7/9/13, 12:07 PM

Add this to the header:

from datetime import date

Return this on your onchange:

date.today().strftime('%Y-%m-%d')

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

Question tools

1 follower(s)

Stats

Asked: 7/9/13, 11:57 AM
Seen: 1800 times
Last updated: 3/16/15, 8:10 AM