[MERGE] point_of_sale: IE error message, simplification of product categories

bzr revid: fva@openerp.com-20121123170642-rwairu0ljiwv27j4
This commit is contained in:
Frédéric van der Essen 2012-11-23 18:06:42 +01:00
commit e72a88a630
11 changed files with 242 additions and 27 deletions

View File

@ -1305,9 +1305,10 @@ class product_product(osv.osv):
_columns = {
'income_pdt': fields.boolean('Point of Sale Cash In', help="Check if, this is a product you can use to put cash into a statement for the point of sale backend."),
'expense_pdt': fields.boolean('Point of Sale Cash Out', help="Check if, this is a product you can use to take cash from a statement for the point of sale backend, example: money lost, transfer to bank, etc."),
'available_in_pos': fields.boolean('Available in the Point of Sale', help='Check if you want this product to appear in the Point of Sale'),
'pos_categ_id': fields.many2one('pos.category','Point of Sale Category',
help="If you want to sell this product through the point of sale, select the category it belongs to."),
'to_weight' : fields.boolean('To Weigh', help="Check if the product should be weighted (mainly used with self check-out interface)."),
help="The Point of Sale Category this products belongs to. Those categories are used to group similar products and are specific to the Point of Sale."),
'to_weight' : fields.boolean('To Weight', help="Check if the product should be weighted (mainly used with self check-out interface)."),
}
def _default_pos_categ_id(self, cr, uid, context=None):
@ -1332,6 +1333,7 @@ class product_product(osv.osv):
_defaults = {
'to_weight' : False,
'available_in_pos': True,
'pos_categ_id' : _default_pos_categ_id,
}

File diff suppressed because one or more lines are too long

View File

@ -618,6 +618,7 @@
<field name="arch" type="xml">
<group name="sale" position="inside">
<group name="pos" string="Point of Sale">
<field name="available_in_pos"/>
<field name="pos_categ_id"/>
<field name="to_weight" />
<field name="income_pdt"/>

View File

@ -1395,3 +1395,25 @@
border-radius: 4px;
}
/* ********* Unsupported Browser Page ********* */
.point-of-sale .not-supported-browser{
position: absolute;
z-index: 100000;
top: 0; bottom: 0; left: 0; right: 0;
background: #2C2C2C;
}
.point-of-sale .not-supported-browser .message{
width:600px;
margin-top: 100px;
margin-left: auto;
margin-right: auto;
text-align: center;
color: #d3d3d3;
font-size: 14px;
}
.point-of-sale .not-supported-browser img{
border-collapse: separate;
box-shadow: 0px 3px 38px rgba(0,0,0,0.3);
border-radius: 3px;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

View File

@ -134,7 +134,7 @@ function openerp_pos_db(instance, module){
for(var i = 0, len = products.length; i < len; i++){
var product = products[i];
var search_string = this._product_search_string(product);
var categ_id = product.pos_categ_id[0];
var categ_id = product.pos_categ_id ? product.pos_categ_id[0] : this.root_category_id;
if(!stored_categories[categ_id]){
stored_categories[categ_id] = [];
}

View File

@ -79,10 +79,11 @@ function openerp_pos_devices(instance,module){ //module is instance.point_of_sal
//the client is starting to weight
weighting_start: function(){
if(!this.weighting){
this.weight = 0;
this.weighting = true;
this.bypass_proxy = false;
return this.message('weighting_start');
if(!this.bypass_proxy){
this.weight = 0;
return this.message('weighting_start');
}
}
},
@ -104,18 +105,25 @@ function openerp_pos_devices(instance,module){ //module is instance.point_of_sal
}
},
// sets a custom weight, ignoring the proxy returned value until the next weighting_end
// sets a custom weight, ignoring the proxy returned value.
debug_set_weight: function(kg){
this.bypass_proxy = true;
this.weight = kg;
},
// resets the custom weight and re-enable listening to the proxy for weight values
debug_reset_weight: function(){
this.bypass_proxy = false;
this.weight = 0;
},
// the client has finished weighting products
weighting_end: function(){
this.weight = 0;
this.weighting = false;
this.bypass_proxy = false;
return this.message('weighting_end');
if(!this.bypass_proxy){
this.weight = 0;
this.weighting = false;
this.message('weighting_end');
}
},
// the pos asks the client to pay 'price' units

View File

@ -172,7 +172,7 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal
'product.product',
['name', 'list_price','price','pos_categ_id', 'taxes_id', 'ean13',
'to_weight', 'uom_id', 'uos_id', 'uos_coeff', 'mes_type', 'description_sale', 'description'],
[['pos_categ_id','!=', false],['sale_ok','=',true]],
[['sale_ok','=',true],['available_in_pos','=',true]],
{pricelist: self.get('shop').pricelist_id[0]} // context for price
);
}).then(function(products){

View File

@ -467,6 +467,7 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa
close: function(){
this._super();
clearInterval(this.intervalID);
this.pos.proxy.weighting_end();
},
});
@ -585,21 +586,6 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa
};
};
/*
module.BasicPaymentScreen = module.ScreenWidget.extend({
queue: new JobQueue(),
start_payment_transaction: function(){
},
update_payment_transaction: function(){
},
cancel_payment_transaction: function(){
},
show: function(){
this._super();
},
});
*/
module.ClientPaymentScreenWidget = module.ScreenWidget.extend({
template:'ClientPaymentScreenWidget',

View File

@ -712,6 +712,9 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa
self.pos.proxy.debug_set_weight(kg);
}
});
this.$('.button.reset_weight').click(function(){
self.pos.proxy.debug_reset_weight();
});
this.$('.button.custom_ean').click(function(){
var ean = self.pos.barcode_reader.sanitize_ean(self.$('input.ean').val() || '0');
self.$('input.ean').val(ean);

View File

@ -32,6 +32,18 @@
</div>
<div class="loader">
</div>
&lt;!--[if IE]&gt;
<div class='not-supported-browser'>
<div class='message'>
<img src='/point_of_sale/static/src/img/pos_screenshot.jpg' />
<p>
The Point of Sale is not supported by Microsoft Internet Explorer. Please use
a modern browser like <a href="http://www.mozilla.org/firefox/" target="_blank">Mozilla Firefox</a>
or <a href="http://www.google.com/chrome" target="_blank">Google Chrome</a>.
</p>
</div>
</div>
&lt;![endif]--&gt;
</div>
</t>
@ -445,6 +457,7 @@
<ul>
<li><input type="text" class="weight"></input></li>
<li class="button set_weight">Set Weight</li>
<li class="button reset_weight">Reset</li>
</ul>
<p class="category">Barcode Scanner</p>