Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
3112 Visualizzazioni
I write javascript as below and try to change build-in button'text. I test the javascript in google chroe is successful.
But I do now know where to put the javascript. How to I modify the code to odoo' style?

var elements1
= document.getElementsByClassName('btn btn-sm oe_button btn-primary o_formdialog_save');
if (elements1.length == 1)
{
var e1 = elements1[0];
e1.textContent="Save(One)";
}


Avatar
Abbandona

Do you want to change "save" button's text?

Autore Risposta migliore
I want to change the button text "儲存 & 關閉" to be "儲存(僅一品項)".
But I do not want to use the thanslation of language.
I had wroten the javascript code to change the button text successfully in the google chrome devtools' console.
I do not know wehere should I put the javascript code.
Should I put the javascript to start function or another place?
Should I transfer the javascript to the javascript of the odoo syntax?

Those are the javascript as below:

var elements1 = document.getElementsByClassName('btn btn-sm oe_button btn-primary o_formdialog_save');
if (elements1.length == 1)
{
var e1 = elements1[0];
e1.textContent="儲存(僅一品項)";
}

Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
6
mar 18
65810
1
lug 17
3140
0
mar 24
1022
0
gen 19
3942
0
set 17
3122