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.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
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.
Add this to the header:
from datetime import date
Return this on your onchange:
date.today().strftime('%Y-%m-%d')
Using Odoo Studio and an automated action, you can simply trigger such a Python expression on the field:
You're all set! | |||
you can : datetime.datetime.now()
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up