How to get field value from python to javascript ?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Accounting
- Inventory
- PoS
- Project management
- MRP
This question has been flagged
1
Reply
7095
Views
You may try like this in your javascript function, a simple example to fetch email of a partner:
var model = new instance.web.Model("res.partner"); model.query(["email"])
.filter([['name', '=', 'MouBou']])
.limit(1)
.then(function(result) { self.$el.append("<div> Your email id is " + result.email + "</div>");});
You may use model.query() to combine search & read from your python models based on conditions or you may use model.call() to call any python methods defined in your model.
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up