From: Jay (Open ERP) Date: Thu, 25 Feb 2010 07:04:49 +0000 (+0530) Subject: [FIX] Sale : Onchange of product/qty corrected when uos is present.Product: Help... X-Git-Tag: 5.0.7-server~8 X-Git-Url: http://git.inspyration.org/?a=commitdiff_plain;h=04dacebb77cc52201663a45837fbedd497bd6e1d;p=odoo%2Fodoo.git [FIX] Sale : Onchange of product/qty corrected when uos is present.Product: Help corrected for uom to uos conversion. bzr revid: jvo@tinyerp.com-20100225070449-g430xyv1x8llr9z6 --- diff --git a/addons/product/product.py b/addons/product/product.py index 1220176..c0088e9 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -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'), diff --git a/addons/sale/sale.py b/addons/sale/sale.py index 0cbd63d..ebe7aba 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -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