[IMP] point_of_sale: you must now use available_in_pos to make product available in pos ... Products without categories will appear at the root category

bzr revid: fva@openerp.com-20121122175254-ippyf1rstggvvwh7
This commit is contained in:
Frédéric van der Essen
2012-11-22 18:52:54 +01:00
parent e586141984
commit 4d90fdd32e
6 changed files with 187 additions and 19 deletions
+4 -2
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
@@ -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"/>
+1 -1
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] = [];
}
+1 -1
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){
@@ -586,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',