Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
3560 Widoki

Hello,

I am trying to build a new app, using Studio, and I want to have a field that autocompletes with the value of a date I enter into an "input date" field + a number of days.

(I would also like for the number of  days to change according to a box which is either checked or not checked).

Can anyone help me  (I  know  nothing  about  phyton  but  I  understand  coding )?

Thank you!

Awatar
Odrzuć
Najlepsza odpowiedź

Hey Leo,

You need to add two fields using studio.
1. x_studio_date_field : date field which will be compute
2. x_studio_no_of_days : integer field which will add the number of days to date field

Here, default x_studio_date_field - Today's date
x_studio_no_of_days - 0

You need to write the below compute method in x_studio_date_field field. You can access Properties and scroll down and click More. Further, you need to write the dependent field x_studio_no_of_days. So every time whenever you change the x_studio_no_of_days it will add to x_studio_date_field date.

for record in self:
record ['x_studio_date_field'] = datetime.datetime.now () + datetime.timedelta(days=record.x_studio_no_of_days)

Thanks & Regards,

Email: odoo@aktivsoftware.com

Skype: kalpeshmaheshwari

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
1
lut 24
3502
2
lip 25
12274
3
maj 24
6860
0
wrz 20
3381
1
paź 23
2880