From 5f7a84471419238f13b1d458c24e9c7578c474a2 Mon Sep 17 00:00:00 2001 From: "JMA (OpenERP)" Date: Wed, 12 May 2010 19:01:33 +0530 Subject: [PATCH] [FIX] Sale : Onchange of product/qty corrected when uos is present.Product: Help corrected for uom to uos conversion. bzr revid: jma@tinyerp.com-20100512133133-sjsmt800r190dws5 --- addons/product/product.py | 2 +- addons/sale/sale.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/product/product.py b/addons/product/product.py index e8a226597e7..9ce2c8ac56e 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -280,7 +280,7 @@ class product_template(osv.osv): help='Used by companies that manage two units of measure: invoicing and inventory 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 = uos * 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 905f46b6570..a48c86b49ce 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -1070,7 +1070,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