datarecord load
bzr revid: al@openerp.com-20110317140638-dgsu44ci48nnpevq
This commit is contained in:
parent
35b6a7efec
commit
b8b37b18a2
|
@ -177,6 +177,17 @@ class DataSet(openerpweb.Controller):
|
||||||
values = m.read(ids, fields)
|
values = m.read(ids, fields)
|
||||||
return {'ids': ids, 'values': values}
|
return {'ids': ids, 'values': values}
|
||||||
|
|
||||||
|
class DataRecord(openerpweb.Controller):
|
||||||
|
_cp_path = "/base/datarecord"
|
||||||
|
@openerpweb.jsonrequest
|
||||||
|
def load(self,req,model,id,fields):
|
||||||
|
m = req.session.model(model)
|
||||||
|
value = {}
|
||||||
|
r = m.read([id])
|
||||||
|
if r:
|
||||||
|
value = r[0]
|
||||||
|
return {'value': value}
|
||||||
|
|
||||||
class FormView(openerpweb.Controller):
|
class FormView(openerpweb.Controller):
|
||||||
_cp_path = "/base/formview"
|
_cp_path = "/base/formview"
|
||||||
@openerpweb.jsonrequest
|
@openerpweb.jsonrequest
|
||||||
|
|
|
@ -130,10 +130,10 @@ openerp.base.DataRecord = openerp.base.Controller.extend({
|
||||||
this.values = {};
|
this.values = {};
|
||||||
},
|
},
|
||||||
load: function(id) {
|
load: function(id) {
|
||||||
// READ
|
this.rpc("/base/datarecord/load", {"model": this.model, "id": this.id, "fields": "todo"}, this.on_loaded);
|
||||||
},
|
},
|
||||||
on_loaded: function() {
|
on_loaded: function(result) {
|
||||||
// set t this.values = data.rea },
|
this.values = result.values;
|
||||||
},
|
},
|
||||||
on_change: function() {
|
on_change: function() {
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue