Backbone.Model.prototype.initialize.call(this, attributes);
var self = this;
this.session = session;
- this.dao = new module.LocalStorageDAO(); // used to store the order's data on the Hard Drive
this.ready = $.Deferred(); // used to notify the GUI that the PosModel has loaded all resources
this.flush_mutex = new $.Mutex(); // used to make sure the orders are sent to the server once at time
push_order: function(record) {
this.db.add_order(record);
this.flush();
- /*
- return this.dao.add_operation(record).pipe(function(){
- return self.flush();
- });
- */
},
//creates a new empty order and sets it as the current order
this.renderElement();
},
get_image_url: function() {
- return '/web/binary/image?session_id='+instance.connection.session_id+'&model=product.product&field=image&id='+this.model.get('id');
+ var url = '/web/binary/image?session_id='+instance.connection.session_id+'&model=product.product&field=image&id='+this.model.get('id');
+ console.log('Requesting url:'+ url);
+ return url;
},
renderElement: function() {
this._super();