Hello ;
Dumb question maybe but...
I'm looking for the way to "send"/"put in place" default values inside each fields of my form (in the website part).
I have tried this way ( and it's ok ✔), if i prepare each default value in specifics variables and then place each field name with the good variable :
return request.render("module_name.id_of_the_form",
{
'first_name': user_connected_name,
'email': mail_user_connected
})
With this way, each field in my form have the good default value needed ( one variable by field).
⚠ But I wish to know why this one bellow doesn't works, when i use a variable as a dictionary :
default_values = {}
default_values['first_name'] = request.env.user.partner_id.name
default_values['email'] = request.env.user.partner_id.email
return request.render( "module_name.id_of_the_form
", {default_values : 'default_values'])
The default_values dictionary contain all the informations needed to be put in place in the form, but the form didn't take thoses informations.
Thanks for your help :)