[FIX] Sale : Onchange of product/qty corrected when uos is present.Product: Help...
authorJay (Open ERP) <jvo@tinyerp.com>
Thu, 25 Feb 2010 07:04:49 +0000 (12:34 +0530)
committerJay (Open ERP) <jvo@tinyerp.com>
Thu, 25 Feb 2010 07:04:49 +0000 (12:34 +0530)
bzr revid: jvo@tinyerp.com-20100225070449-g430xyv1x8llr9z6

addons/product/product.py
addons/sale/sale.py

index 1220176..c0088e9 100644 (file)
@@ -265,7 +265,7 @@ class product_template(osv.osv):
             help='Used by companies that manages two unit of measure: invoicing and stock management. For example, in food industries, you will manage a stock of ham but invoice in Kg. Keep empty to use the default UOM.'),
         'uos_coeff': fields.float('UOM -> UOS Coeff', digits=(16,4),
             help='Coefficient to convert UOM to UOS\n'
-            ' uom = uos * coeff'),
+            ' uos = uom * coeff'),
         'mes_type': fields.selection((('fixed', 'Fixed'), ('variable', 'Variable')), 'Measure Type', required=True),
         'seller_delay': fields.function(_calc_seller_delay, method=True, type='integer', string='Supplier Lead Time', help="This is the average delay in days between the purchase order confirmation and the reception of goods for this product and for the default supplier. It is used by the scheduler to order requests based on reordering delays."),
         'seller_ids': fields.one2many('product.supplierinfo', 'product_id', 'Partners'),
index 0cbd63d..ebe7aba 100644 (file)
@@ -916,7 +916,6 @@ class sale_order_line(osv.osv):
         if partner_id:
             lang = partner_obj.browse(cr, uid, partner_id).lang
         context = {'lang': lang, 'partner_id': partner_id}
-
         if not product:
             return {'value': {'th_weight': 0, 'product_packaging': False,
                 'product_uos_qty': qty}, 'domain': {'product_uom': [],
@@ -987,7 +986,7 @@ class sale_order_line(osv.osv):
                         'product_uos':
                         [('category_id', '=', uos_category_id)]}
 
-        elif uos: # only happens if uom is False
+        elif uos and not uom: # only happens if uom is False
             result['product_uom'] = product_obj.uom_id and product_obj.uom_id.id
             result['product_uom_qty'] = qty_uos / product_obj.uos_coeff
             result['th_weight'] = result['product_uom_qty'] * product_obj.weight