[MERGE]
authorCristian Salamea <ovnicraft@gmail.com>
Mon, 27 Dec 2010 05:26:33 +0000 (00:26 -0500)
committerCristian Salamea <ovnicraft@gmail.com>
Mon, 27 Dec 2010 05:26:33 +0000 (00:26 -0500)
bzr revid: ovnicraft@gmail.com-20101227052633-hi3op794dkd3pn5m

1  2 
addons/point_of_sale/point_of_sale.py
addons/point_of_sale/point_of_sale_view.xml
addons/point_of_sale/wizard/pos_scan_product.py

@@@ -176,11 -173,10 +176,12 @@@ class pos_order(osv.osv)
                              (1-(line.discount or 0.0)/100.0), line.qty),
                              res[order.id]['amount_tax'])
                  elif line.qty != 0.0:
 -                    for c in tax_obj.compute_all(cr, uid, line.product_id.taxes_id, line.price_unit * (1-(line.discount or 0.0)/100.0), line.qty,  line.product_id, line.order_id.partner_id)['taxes']:
 +                    for c in tax_obj.compute_all(cr, uid, line.product_id.taxes_id, \
 +                                                 line.price_unit * (1-(line.discount or 0.0)/100.0), \
 +                                                 line.qty,  line.product_id, line.order_id.partner_id)['taxes']:
                          val += c.get('amount', 0.0)
-                     res[order.id]['amount_tax'] = cur_obj.round(cr, uid, cur, val)
+             res[order.id]['amount_tax'] = cur_obj.round(cr, uid, cur, val)
+             res[order.id]['amount_total'] = res[order.id]['amount_tax'] + cur_obj.round(cr, uid, cur, val1)
          return res
  
      def _sale_journal_get(self, cr, uid, context=None):
          'journal_entry': fields.boolean('Journal Entry'),
      }
  
      def _select_pricelist(self, cr, uid, context=None):
 -        """ To get default pricelist for the order"
 +        """ To get default pricelist for the order
          @param name: Names of fields.
          @return: pricelist ID
          """
@@@ -25,12 -25,10 +25,12 @@@ from tools.translate import 
  class pos_scan_product(osv.osv_memory):
      _name = 'pos.scan.product'
      _description = 'Scan product'
 +    
      _columns = {
 -        'gencod': fields.char('Barcode',size=13,required= True)
 +        'gencod': fields.char('Barcode', size=13, required=True)
      }
 +    
-     def scan(self, cr, uid, ids, context):
+     def scan(self, cr, uid, ids, context=None):
          """ 
           To get the gencod and scan product         
           @param self: The object pointer.
           @param context: A standard dictionary 
           @return : retrun gencod
          """
-                 
-         data = self.read(cr, uid, ids)[0]
+         if context is None:
+             context = {}
+         data=self.read(cr, uid, ids)[0]
 -        record_id = context and context.get('active_id',False)
 +        record_id = context and context.get('active_id', False)
          result =self. pool.get('pos.order.line')._scan_product(cr, uid, data['gencod'], 1, record_id)
          return {'gencod': False}
 +
  pos_scan_product()
  # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: