Ir al contenido
Menú
Se marcó esta pregunta
2 Respuestas
2847 Vistas

Hello,


I wrote a function in js which, at the end, insert a value in a field of a account.move.line form with this line :

document.getElementsByName("s_configuration")[0].value = clipText;


It works well but when i click on the save button of the form, the value is not saved

If i modify something in the field, its value is saved.

I think that odoo detect manual modification but not js modification or something like that


Do you know how to indicate to odoo that it must save this field ?

For information, i'm a beginner in js and python


Vincent

Avatar
Descartar
Mejor respuesta

Hello Vincent,

Check the example at https://stackoverflow.com/questions/60324652/how-to-programmatically-update-an-input-inside-shadow-dom

Of particular interest will be shadowInput.dispatchEvent(new Event('input'))

Avatar
Descartar
Mejor respuesta

Hello JJB Conseil,

You are doing to set the value like as placeholder but it doesn't entry in input field as a value.

so, you can try this to save the value:

document.getElementsByName("s_configuration")[0].val('clipText')

or

document.getElementsByName("s_configuration")[0].text('clipText')

Regards,




Email:      odoo@aktivsoftware.com  

Skype: kalpeshmaheshwari

   

Avatar
Descartar
Autor

Hello Jainesh,

Thank you for your anwer and sorry for the delay

I tried your solution but with the same result.

The value is displayed in the field but not saved when i click on save button.

Do you have other idea ?

Vincent

Publicaciones relacionadas Respuestas Vistas Actividad
0
jul 25
180
0
jun 25
436
1
jun 25
689
1
jun 25
710
1
may 25
1246