[MERGE] forward port of branch 7.0 up to da15c9d
authorDenis Ledoux <dle@odoo.com>
Fri, 14 Nov 2014 14:59:33 +0000 (15:59 +0100)
committerDenis Ledoux <dle@odoo.com>
Fri, 14 Nov 2014 14:59:33 +0000 (15:59 +0100)
1  2 
addons/account/account.py
addons/point_of_sale/security/point_of_sale_security.xml
addons/point_of_sale/static/src/js/models.js
addons/product/product.py
addons/purchase/purchase.py
addons/stock/stock.py
addons/web/static/src/js/search.js
addons/web/static/src/js/view_form.js

Simple merge
          <field name="name">Point Of Sale Config</field>
          <field name="model_id" ref="model_pos_config" />
          <field name="global" eval="True" />
 -        <field name="domain_force">['|',('shop_id.company_id','=',False),('shop_id.company_id','child_of',[user.company_id.id])]</field>
 +        <field name="domain_force">[('warehouse_id.company_id','child_of',[user.company_id.id])]</field>
      </record>
+     <record id="rule_pos_order_report_multi_company" model="ir.rule">
+         <field name="name">Point Of Sale Order Analysis multi-company</field>
+         <field name="model_id" ref="model_report_pos_order"/>
+         <field name="global" eval="True"/>
+         <field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
+     </record>
  </data>
  </openerp>
@@@ -665,13 -491,10 +665,13 @@@ function openerp_pos_models(instance, m
          get_tax: function(){
              return this.get_all_prices().tax;
          },
 +        get_tax_details: function(){
 +            return this.get_all_prices().taxDetails;
 +        },
          get_all_prices: function(){
              var self = this;
 -            var currency_rounding = this.pos.get('currency').rounding;
 +            var currency_rounding = this.pos.currency.rounding;
-             var base = round_pr(this.get_quantity() * this.get_unit_price() * (1.0 - (this.get_discount() / 100.0)), currency_rounding);
+             var base = round_pr(round_pr(this.get_quantity() * this.get_unit_price(), currency_rounding) * (1.0 - (this.get_discount() / 100.0)), currency_rounding);
              var totalTax = base;
              var totalNoTax = base;
              
@@@ -786,11 -687,11 +786,11 @@@ class product_product(osv.osv)
                  # on a database with thousands of matching products, due to the huge merge+unique needed for the
                  # OR operator (and given the fact that the 'name' lookup results come from the ir.translation table
                  # Performing a quick memory merge of ids in Python will give much better performance
 -                ids = set()
 -                ids.update(self.search(cr, user, args + [('default_code',operator,name)], limit=limit, context=context))
 +                ids = set(self.search(cr, user, args + [('default_code', operator, name)], limit=limit, context=context))
                  if not limit or len(ids) < limit:
                      # we may underrun the limit because of dupes in the results, that's fine
 -                    ids.update(self.search(cr, user, args + [('name',operator,name), ('id', 'not in', list(ids))], limit=(limit and (limit-len(ids)) or False) , context=context))
 +                    limit2 = (limit - len(ids)) if limit else False
-                     ids.update(self.search(cr, user, args + [('name', operator, name)], limit=limit2, context=context))
++                    ids.update(self.search(cr, user, args + [('name', operator, name), ('id', 'not in', list(ids))], limit=limit2, context=context))
                  ids = list(ids)
              elif not ids and operator in expression.NEGATIVE_TERM_OPERATORS:
                  ids = self.search(cr, user, args + ['&', ('default_code', operator, name), ('name', operator, name)], limit=limit, context=context)
Simple merge
Simple merge
Simple merge
Simple merge