in pos javascript there this code:
module.PosModel = Backbone.Model.extend({
.....
.....
models: [
{
model: 'res.users',
fields: ['name','company_id'],
ids: function(self){ return [self.session.uid]; },
loaded: function(self,users){ self.user = users[0]; },
},
....
....
]
In my costum module i just want to add one element to the end of the list, I managed to add it doing this:
module.PosModel = module.PosModel.extend({
models: [
{
model: 'res.users',
fields: ['name','company_id'],
ids: function(self){
return [self.session.uid];
},
loaded: function(self,users){ self.user = users[0]; },
},
.....
// repeate the same list with my new element
],
}
Now my question is how to just add my element to the old list without having to repeate the hole list.