Skip to Content
Menu
This question has been flagged
3 Replies
15413 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.

Avatar
Discard
Best Answer

Add this to the header:

from datetime import date

Return this on your onchange:

date.today().strftime('%Y-%m-%d')
Avatar
Discard
Best Answer

Using Odoo Studio and an automated action, you can simply trigger such a Python expression on the field: 

time.strftime('%Y-%m-%d')

You're all set!



Avatar
Discard
Best Answer

you can : datetime.datetime.now()

Avatar
Discard