I am trying to display field values when button is clicked. This button is not linked to any module.It is in the navigation bar just beside the conversations. How can i get the field values from a particular module on button click.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Contabilidad
- Inventario
- PoS
- Project
- MRP
Se marcó esta pregunta
1
Responder
8500
Vistas
Your JS code should look like this:
var model = require('web.DataModel');
$('#my-button').click(function() {
new Model('addon.model').query(['name'])
.filter([['id', '=', 1]])
.first()
.then(function(res) {
console.log(res);
});
});
Check out the docs for more info: https://www.odoo.com/documentation/10.0/reference/javascript.html#high-level-api-calling-into-odoo-models
¿Le interesa esta conversación? ¡Participe en ella!
Cree una cuenta para poder utilizar funciones exclusivas e interactuar con la comunidad.
RegistrarsePublicaciones relacionadas | Respuestas | Vistas | Actividad | |
---|---|---|---|---|
|
2
jun 23
|
42273 | ||
|
1
jun 23
|
3505 | ||
Get data from JS file to XML file
Resuelto
|
|
1
ago 20
|
8905 | |
|
2
jun 20
|
3952 | ||
|
1
sept 18
|
106 |