I want to customize the onclick Javascript action for the form of the model stock.picking. What is the easiest way to do this
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Contabilità
- Magazzino
- PoS
- Project
- MRP
La domanda è stata contrassegnata
2
Risposte
13929
Visualizzazioni
Hello Jan,
Add code in your js file
/**window.alert("Page is Reload");**/
odoo.define('Module.js file name', function (require) {
"use strict";
var form_widget = require('web.form_widgets');
var core = require('web.core');
var _t = core._t;
var QWeb = core.qweb;
form_widget.WidgetButton.include({
on_click: function() {
if(this.node.attrs.custom === "click"){
//code //
return;
}
this._super();
},
});
});
and define into your xml file :
<button name="java_script" string="Java Script" type="object" custom="click"/>
There java_script is my function name which one define in .py file.
I hope it's help you
Thanks
How can i accomplish this on Version 12 .
Somehow the module web.form_widgets does not exist in this version.
Thanks in advance.
Ti stai godendo la conversazione? Non leggere soltanto, partecipa anche tu!
Crea un account oggi per scoprire funzionalità esclusive ed entrare a far parte della nostra fantastica community!
RegistratiPost correlati | Risposte | Visualizzazioni | Attività | |
---|---|---|---|---|
|
0
mar 17
|
8465 | ||
|
0
lug 25
|
261 | ||
|
0
giu 25
|
486 | ||
|
1
giu 25
|
711 | ||
|
1
giu 25
|
736 |