跳至內容
選單
此問題已被標幟
2 回覆
2837 瀏覽次數

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

相關帖文 回覆 瀏覽次數 活動
0
6月 25
336
1
6月 25
650
1
6月 25
643
1
5月 25
1199
0
3月 25
675