summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorFrédéric van der Essen <fvdessen@gmail.com>2015-06-30 16:54:21 +0200
committerFrédéric van der Essen <fvdessen@gmail.com>2015-06-30 16:54:21 +0200
commit3ae0ce43d4bc0c4f82f2c394ff1b8c95d8a26cc6 (patch)
tree44ac74c36c3c7ccedf29c8492c53ddbe4f3699d5 /addons
parentd6afe624eb7a8ba408ca00febdcf1acea9fdca02 (diff)
[IMP] point_of_sale: reactivating product category images (disabled by default, as they take too much space on tablets.)
Diffstat (limited to 'addons')
-rw-r--r--addons/point_of_sale/point_of_sale.py1
-rw-r--r--addons/point_of_sale/point_of_sale_view.xml1
-rw-r--r--addons/point_of_sale/static/src/css/pos.css2
-rw-r--r--addons/point_of_sale/static/src/js/models.js2
-rw-r--r--addons/point_of_sale/static/src/js/screens.js14
5 files changed, 7 insertions, 13 deletions
diff --git a/addons/point_of_sale/point_of_sale.py b/addons/point_of_sale/point_of_sale.py
index 93ec9156783..4e92debba17 100644
--- a/addons/point_of_sale/point_of_sale.py
+++ b/addons/point_of_sale/point_of_sale.py
@@ -65,6 +65,7 @@ class pos_config(osv.osv):
'iface_precompute_cash': fields.boolean('Prefill Cash Payment', help='The payment input will behave similarily to bank payment input, and will be prefilled with the exact due amount'),
'iface_tax_included': fields.boolean('Include Taxes in Prices', help='The displayed prices will always include all taxes, even if the taxes have been setup differently'),
'iface_start_categ_id': fields.many2one('pos.category','Start Category', help='The point of sale will display this product category by default. If no category is specified, all available products will be shown'),
+ 'iface_display_categ_images': fields.boolean('Display Category Pictures', help="The product categories will be displayed with pictures."),
'receipt_header': fields.text('Receipt Header',help="A short text that will be inserted as a header in the printed receipt"),
'receipt_footer': fields.text('Receipt Footer',help="A short text that will be inserted as a footer in the printed receipt"),
'proxy_ip': fields.char('IP Address', help='The hostname or ip address of the hardware proxy, Will be autodetected if left empty', size=45),
diff --git a/addons/point_of_sale/point_of_sale_view.xml b/addons/point_of_sale/point_of_sale_view.xml
index 3a1e0bc6931..db9a92d2f62 100644
--- a/addons/point_of_sale/point_of_sale_view.xml
+++ b/addons/point_of_sale/point_of_sale_view.xml
@@ -705,6 +705,7 @@
<field name="iface_fullscreen" />
<field name="iface_big_scrollbars" />
<field name="iface_print_auto" />
+ <field name="iface_display_categ_images" />
<field name="iface_print_skip_screen" attrs="{'invisible' : [('iface_print_auto', '=', False)]}" />
</group>
</group>
diff --git a/addons/point_of_sale/static/src/css/pos.css b/addons/point_of_sale/static/src/css/pos.css
index d534b3fead6..b301995fb95 100644
--- a/addons/point_of_sale/static/src/css/pos.css
+++ b/addons/point_of_sale/static/src/css/pos.css
@@ -910,7 +910,7 @@ td {
vertical-align: top;
display: inline-block;
font-size: 11px;
- margin: 5px !important;
+ margin: 8px !important;
width: 120px;
height:120px;
background:#fff;
diff --git a/addons/point_of_sale/static/src/js/models.js b/addons/point_of_sale/static/src/js/models.js
index a8560479c52..299274f5679 100644
--- a/addons/point_of_sale/static/src/js/models.js
+++ b/addons/point_of_sale/static/src/js/models.js
@@ -307,7 +307,7 @@ exports.PosModel = Backbone.Model.extend({
},
},{
model: 'pos.category',
- fields: ['id','name','parent_id','child_id'],
+ fields: ['id','name','parent_id','child_id','image'],
domain: null,
loaded: function(self, categories){
self.db.add_categories(categories);
diff --git a/addons/point_of_sale/static/src/js/screens.js b/addons/point_of_sale/static/src/js/screens.js
index 52a0f9d5fcd..aed5e21e6e4 100644
--- a/addons/point_of_sale/static/src/js/screens.js
+++ b/addons/point_of_sale/static/src/js/screens.js
@@ -671,25 +671,17 @@ var ProductCategoriesWidget = PosBaseWidget.extend({
this.el = el_node;
- var hasimages = false; //if none of the subcategories have images, we don't display buttons with icons
- /*
- for(var i = 0; i < this.subcategories.length; i++){
- if(this.subcategories[i].image){
- hasimages = true;
- break;
- }
- }
- */
+ var withpics = this.pos.config.iface_display_categ_images;
var list_container = el_node.querySelector('.category-list');
if (list_container) {
- if (!hasimages) {
+ if (!withpics) {
list_container.classList.add('simple');
} else {
list_container.classList.remove('simple');
}
for(var i = 0, len = this.subcategories.length; i < len; i++){
- list_container.appendChild(this.render_category(this.subcategories[i],hasimages));
+ list_container.appendChild(this.render_category(this.subcategories[i],withpics));
}
}