[MERGE] from master
authorFrédéric van der Essen <fvdessen@gmail.com>
Tue, 9 Dec 2014 22:38:33 +0000 (23:38 +0100)
committerFrédéric van der Essen <fvdessen@gmail.com>
Tue, 9 Dec 2014 22:38:33 +0000 (23:38 +0100)
12 files changed:
1  2 
addons/account/account_view.xml
addons/point_of_sale/point_of_sale_view.xml
addons/point_of_sale/static/src/js/models.js
addons/point_of_sale/static/src/js/screens.js
addons/point_of_sale/static/src/js/widgets.js
addons/product/product.py
addons/product/product_view.xml
addons/stock/stock.py
addons/stock/stock_view.xml
addons/web/static/src/css/base.css
addons/web/static/src/css/base.sass
openerp/addons/base/res/res_partner.py

Simple merge
@@@ -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);
              },
          },{
              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);
@@@ -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();
Simple merge
Simple merge
@@@ -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
                      <h2><field name="location_id"/></h2>
  
                      <group>
-                         <div>
-                             <group string="Additional Information">
-                                 <field name="usage"/>
-                                 <field name="partner_id"/>
-                                 <field name="company_id" groups="base.group_multi_company" widget="selection"/>
-                                 <field name="scrap_location"/>
-                                 <field name="active"/>
-                             </group>
-                         </div>
-                         <div>
-                             <group string="Localization" name="localization">
-                                 <field name="posx"/>
-                                 <field name="posy"/>
-                                 <field name="posz"/>
-                                 <field name="barcode"/>
-                             </group>
-                         </div>
-                         <div>
-                             <group string="Logistics" groups="stock.group_adv_location">
-                                 <field name="removal_strategy_id" options="{'no_create': True}"/>
-                                 <field name="putaway_strategy_id"/>
-                             </group>
-                         </div>
+                         <group string="Additional Information">
+                             <field name="usage"/>
+                             <field name="partner_id"/>
+                             <field name="company_id" groups="base.group_multi_company" widget="selection"/>
+                             <field name="scrap_location"/>
+                             <field name="active"/>
+                         </group>
+                         <group string="Localization" name="localization">
+                             <field name="posx"/>
+                             <field name="posy"/>
+                             <field name="posz"/>
 -                            <field name="loc_barcode"/>
++                            <field name="barcode"/>
+                         </group>
+                         <group string="Logistics" groups="stock.group_adv_location">
+                             <field name="removal_strategy_id" options="{'no_create': True}"/>
+                             <field name="putaway_strategy_id"/>
+                         </group>
                      </group>
                      <field name="comment" placeholder="External note..."/>
                  </form>
Simple merge
Simple merge