diff --git a/addons/point_of_sale/static/src/js/models.js b/addons/point_of_sale/static/src/js/models.js
index 5928caf7c77..b5792f0124d 100644
--- a/addons/point_of_sale/static/src/js/models.js
+++ b/addons/point_of_sale/static/src/js/models.js
@@ -48,7 +48,7 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal
'units': null,
'units_by_id': null,
- 'selectedOrder': undefined,
+ 'selectedOrder': null,
});
this.get('orders').bind('remove', function(){ self.on_removed_order(); });
@@ -310,6 +310,9 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal
});
module.Product = Backbone.Model.extend({
+ get_image_url: function(){
+ return '/web/binary/image?session_id='instance.session.session_id+'&model=product.product&field=image&id='+this.get('id');
+ },
});
module.ProductCollection = Backbone.Collection.extend({
@@ -339,7 +342,6 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal
get_discount: function(){
return this.discount;
},
- // FIXME
get_product_type: function(){
return this.type;
},
diff --git a/addons/point_of_sale/static/src/js/screens.js b/addons/point_of_sale/static/src/js/screens.js
index e10633f999b..2ead7333bed 100644
--- a/addons/point_of_sale/static/src/js/screens.js
+++ b/addons/point_of_sale/static/src/js/screens.js
@@ -521,13 +521,6 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa
var product = this.get_product();
return (product ? product.get('list_price') : 0) || 0;
},
- get_product_image_url: function() {
- var product = this.get_product();
- if(!product){
- return "";
- }
- return '/web/binary/image?session_id='+instance.session.session_id+'&model=product.product&field=image&id='+product.get('id');
- },
get_product_weight: function(){
return this.weight || 0;
},
diff --git a/addons/point_of_sale/static/src/js/widgets.js b/addons/point_of_sale/static/src/js/widgets.js
index 79e9d3398bc..2aaf9098329 100644
--- a/addons/point_of_sale/static/src/js/widgets.js
+++ b/addons/point_of_sale/static/src/js/widgets.js
@@ -284,12 +284,9 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa
this.click_product_action = options.click_product_action;
},
// returns the url of the product thumbnail
- get_image_url: function() {
- return '/web/binary/image?session_id='+instance.session.session_id+'&model=product.product&field=image&id='+this.model.get('id');
- },
renderElement: function() {
this._super();
- this.$('img').replaceWith(this.pos_widget.image_cache.get_image(this.get_image_url()));
+ this.$('img').replaceWith(this.pos_widget.image_cache.get_image(this.model.get_image_url()));
var self = this;
$("a", this.$el).click(function(e){
if(self.click_product_action){
diff --git a/addons/point_of_sale/static/src/xml/pos.xml b/addons/point_of_sale/static/src/xml/pos.xml
index a3a75ab05e5..46dc4712937 100644
--- a/addons/point_of_sale/static/src/xml/pos.xml
+++ b/addons/point_of_sale/static/src/xml/pos.xml
@@ -185,8 +185,8 @@
-
-
+
+
@@ -346,7 +346,8 @@