I am working on a new widget with static folder in openERP.
But now i want to get a class and access to its attributes or even some records.
Who knows how please?
I am working on a new widget with static folder in openERP.
But now i want to get a class and access to its attributes or even some records.
Who knows how please?
Friends!!!!
I have found the answer by my self:
var model = new instance.web.Model("model_name");
Here you can get your model then you can do whatever you want on it such as this example:
instance.oepetstore.HomePage = instance.web.Widget.extend({
start: function() {
var self = this;
var model = new instance.web.Model("message_of_the_day");
model.call("my_method", [], {context: new
instance.web.CompoundContext()}).then(function(result) {
self.$el.append("<div>Hello " + result["hello"] + "</div>");
// will show "Hello world" to the user
});
},
});
Regards.
you can try to call browse or search ORM methods(see doc) using RPC (see answer here), as any other method you like.
Opret en konto i dag for at få glæde af eksklusive funktioner, og bliv en del af vores skønne fællesskab!
Tilmeld dig| Relaterede indlæg | Besvarelser | Visninger | Aktivitet | |
|---|---|---|---|---|
|
1
sep. 15
|
11138 | |||
|
0
aug. 15
|
4709 | |||
|
1
mar. 15
|
1977 | |||
|
2
mar. 15
|
2030 | |||
|
1
mar. 15
|
5831 |
1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.