Skip to Content

Welcome!

Share and discuss the best content and new marketing ideas, build your professional profile and become a better marketer together.

Sign up

You need to be registered to interact with the community.
This question has been flagged
1 Reply
28 Views

Hi, I use  Odoo Online ( and I need to create a field that transforms the date into the number of the day of the year:

ex. 1 = 1/25/2022 = 25

ex. 2 = 05/14/2022 = 134

ex. 3 = 08/12/2022 = 224

I don't have much experience so please be as simple as possible.


Thank you

Avatar
Discard

Hi,


In Odoo Online you can make use of the Odoo Studio app to do this. To do that please follow the below steps:-


1) Go to settings and turn on the developer mode by clicking the "Activate the developer mode" button under the Developer Tools

2) Now go to the view in which you need to add the field.

3) Now switch to studio mode by clicking on the "Toggle Studio" button found in the top right corner.

4) Now add and name one date field and an integer field using the studio. (You can refer to Odoo Studio Book for help: rec.x_studio_input_date.strftime('%j')"

8) Now you can save it and close the studio view.

Now the integer field will show the day of the year when the value in the input date field is changed

Regards

Avatar
Discard

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!