Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
5916 Visualizzazioni

I am struggling with customized forms in v11.

Using the recruitment module, I modified the contact form adding a new 'surname' field. Thas was done by adding on the HTML what follows:

<div class="form-group form-field o_website_form_required_custom">

    <div class="col-md-3 col-sm-4 text-right">

        <label class="control-label" for="x_surname">Your surname</label>

    </div>    

    <div class="col-md-7 col-sm-8">

        <input type="text" class="form-control o_website_form_input" name="x_apellido" required=""/>

</div>

 Follow next link to see screenshot ->

https://drive.google.com/open?id=1MRfFjvp65_h_vl7zW8tk3QxnNIcRCexs

At the same time I created a new field in Odoo backend that I added to the FormView of the candidate profile in order to have the 'surname' field like follows:

<field type name="x_surname">

Follow next link to see screenshot ->

https://drive.google.com/open?id=1pS-VjPHs7bfPUciFS1kO7SbPBQZID9Uw

But when a candidate fills the form, I don't achieve to insert properly the surname from the form to the candidate profile in backend.

Follow next link to see screenshot ->

https://drive.google.com/open?id=1ZoqU2REHlpwJm_oQ7mXJmNJSqF8v22KA


What else should I do? Is there anything I am missing?

Thanks!

Avatar
Abbandona
Risposta migliore
"""
Restriction of "authorized fields" (fields which can be used in the
form builders) to fields which have actually been opted into form
builders and are writable. By default no field is writable by the
form builder.
"""
What you need to do is to whitelist your custom field by adding this code to
an xml file in the data folder :
<data>
<function model="ir.model.fields" name="formbuilder_whitelist">
<value>crm.lead</value>
<value eval="[
'x_custom_field'
]"/>
</function>
</data>
Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
1
giu 23
5582
2
feb 18
3244
3
feb 21
17566
0
mag 18
98
0
mar 15
3506