Skip to Content
Menu
This question has been flagged
2 Replies
2850 Zobrazenia

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
Zrušiť
Best Answer

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
Zrušiť
Best Answer

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
Zrušiť
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

Related Posts Replies Zobrazenia Aktivita
0
júl 25
261
0
jún 25
487
1
jún 25
711
1
jún 25
736
1
máj 25
1287