[IMP] point_of_sale: reactivating product category images (disabled by default, as they take too much space on tablets.)
This commit is contained in:
@@ -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),
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user