From: Frédéric van der Essen Date: Tue, 9 Dec 2014 22:38:33 +0000 (+0100) Subject: [MERGE] from master X-Git-Url: http://git.inspyration.org/?p=odoo%2Fodoo.git;a=commitdiff_plain;h=c15f748be05b3709f5e16680569abdc2949468e2 [MERGE] from master --- c15f748be05b3709f5e16680569abdc2949468e2 diff --cc addons/point_of_sale/static/src/js/models.js index 7c02103,bc4d4a0..946c7f1 --- a/addons/point_of_sale/static/src/js/models.js +++ b/addons/point_of_sale/static/src/js/models.js @@@ -164,9 -162,14 +164,9 @@@ openerp.point_of_sale.load_models = fun self.units_by_id = units_by_id; } },{ - model: 'res.users', - fields: ['name','ean13'], - domain: null, - loaded: function(self,users){ self.users = users; }, - },{ model: 'res.partner', - fields: ['name','street','city','state_id','country_id','vat','phone','zip','mobile','email','ean13','write_date'], - domain: [['customer','=',true]], + fields: ['name','street','city','state_id','country_id','vat','phone','zip','mobile','email','barcode','write_date'], - domain: null, ++ domain: [['customer','=',true]], loaded: function(self,partners){ self.partners = partners; self.db.add_partners(partners); @@@ -293,11 -267,10 +293,11 @@@ }, },{ model: 'product.product', - fields: ['display_name', 'list_price','price','pos_categ_id', 'taxes_id', 'ean13', 'default_code', + fields: ['display_name', 'list_price','price','pos_categ_id', 'taxes_id', 'barcode', 'default_code', 'to_weight', 'uom_id', 'uos_id', 'uos_coeff', 'mes_type', 'description_sale', 'description', 'product_tmpl_id'], - order: ['sequence','name'], - domain: function(self){ return [['sale_ok','=',true],['available_in_pos','=',true]]; }, ++ order: ['sequence','name'], + domain: [['sale_ok','=',true],['available_in_pos','=',true]], context: function(self){ return { pricelist: self.pricelist.id, display_default_code: false }; }, loaded: function(self, products){ self.db.add_products(products); diff --cc addons/point_of_sale/static/src/js/widgets.js index ad4efcd,da3844e..51f7d19 --- a/addons/point_of_sale/static/src/js/widgets.js +++ b/addons/point_of_sale/static/src/js/widgets.js @@@ -1265,15 -1124,32 +1265,23 @@@ openerp.point_of_sale.load_widgets = fu }, close: function() { var self = this; - - function close(){ - self.pos.push_order().then(function(){ - return new instance.web.Model("ir.model.data").get_func("search_read")([['name', '=', 'action_client_pos_menu']], ['res_id']).pipe(function(res) { - window.location = '/web#action=' + res[0]['res_id']; - },function(err,event) { - event.preventDefault(); - self.screen_selector.show_popup('error',{ - 'message': _t('Could not close the point of sale.'), - 'comment': _t('Your internet connection is probably down.'), - }); - self.close_button.renderElement(); + self.loading_show(); + self.loading_message(_t('Closing ...')); + + self.pos.push_order().then(function(){ - return new instance.web.Model("ir.model.data").get_func("search_read")([['name', '=', 'action_client_pos_menu']], ['res_id']).pipe(function(res) { ++ return new instance.web.Model("ir.model.data").get_func("search_read")([['name', '=', 'action_client_pos_menu']], ['res_id']) ++ .pipe(function(res) { + window.location = '/web#action=' + res[0]['res_id']; ++ },function(err,event) { ++ event.preventDefault(); ++ self.screen_selector.show_popup('error',{ ++ 'message': _t('Could not close the point of sale.'), ++ 'comment': _t('Your internet connection is probably down.'), + }); ++ self.close_button.renderElement(); }); - } - - var draft_order = _.find( self.pos.get('orders').models, function(order){ - return order.get('orderLines').length !== 0 && order.get('paymentLines').length === 0; }); - if(draft_order){ - if (confirm(_t("Pending orders will be lost.\nAre you sure you want to leave this session?"))) { - close(); - } - }else{ - close(); - } + }, destroy: function() { this.pos.destroy(); diff --cc addons/stock/stock.py index e6db4b5,434a2ae..3fb8a69 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@@ -23,13 -23,12 +23,14 @@@ from datetime import date, datetim from dateutil import relativedelta import json import time +import sets +import openerp from openerp.osv import fields, osv + from openerp.tools.float_utils import float_compare, float_round from openerp.tools.translate import _ from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT, DEFAULT_SERVER_DATE_FORMAT -from openerp import SUPERUSER_ID, api +from openerp import SUPERUSER_ID, api, models import openerp.addons.decimal_precision as dp from openerp.addons.procurement import procurement import logging diff --cc addons/stock/stock_view.xml index 85c2455,93e7976..7072a26 --- a/addons/stock/stock_view.xml +++ b/addons/stock/stock_view.xml @@@ -338,29 -338,23 +338,23 @@@

-
- - - - - - - -
-
- - - - - - -
-
- - - - -
+ + + + + + + + + + + - ++ + + + + +