How To Set Default Value For The Field in Odoo12

preview_player
Показать описание
#defaultfieldvalue #odoo12tutorial #createmoduleodoo12
How to set default value for a field in Odoo12 using the code. Here you can call a function from the default attribute of the field and return the default value for the field from the function.

Рекомендации по теме
Комментарии
Автор

Thanks, we can also use compute attribute beside default ?? same result ?

italaa
Автор

+ tip : for current date in appointment


Import the correct Python library for date(times) at the top of your Python file:

from datetime import datetime

and then create the field in the model with the date pre-filled:

your_date_field = fields.Date(string='Your string', default=datetime.today())

KhalilulrahmanAG
Автор

Hi thanks for the tutorial, they are quite helpful. I recently setup odoo community 13 on aws . But when I used nginx to setup access via https . I keep getting :"connection lost, trying to reconnect error" trying to use the some of the solutions recommended online and I corrupted my instance and had to delete and start over as it was no longer accessible via ssh. How do I fix this error so it doesn't affect my new setup. Thank you

monicasena
Автор

how to set default value of field for a specific user

harismasqati