Skip to Content
Menu
This question has been flagged
2 Replies
2521 Views

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
Discard
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
Discard
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
Discard
Author

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 Views Activity
1
Dec 24
130
2
Nov 24
85
1
Oct 24
267
0
Sep 24
213
2
Sep 24
648