Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
2 Відповіді
2814 Переглядів

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

Аватар
Відмінити
Найкраща відповідь

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'))

Аватар
Відмінити
Найкраща відповідь

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

   

Аватар
Відмінити
Автор

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 Відповіді Переглядів Дія
0
черв. 25
256
1
черв. 25
536
1
черв. 25
525
1
трав. 25
1115
0
бер. 25
656