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.

0

How to auto fill datefield with today date?

By
Bonnet Denis
on 7/9/13, 11:57 AM 1,376 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--
2523
| 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')

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)

Stats

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