← Back to team overview

openerp-india team mailing list archive

[Bug 1082409] Re: Can not change UOM on Sales Order Line

 

Hello,

I have fix it with following changes,

addons/sale/sale.py, line 951
--------------------------------------------------
        elif uom: # whether uos is set or not
            default_uom = product_obj.uom_id and product_obj.uom_id.id
            q = product_uom_obj._compute_qty(cr, uid, uom, qty, default_uom)
            # Start kittiu
            #result['product_uom'] = default_uom
            if not product_obj.uos_id:
                result['product_uom'] = uom
            else: # If UOS always force to default_uom
                result['product_uom'] = default_uom
                uom = default_uom
            # End kittiu

addons/product_visible_discount/product_visible_discount.py, line 62
------------------------------------------------------------------------------------------------------------------------
            if uom and uom != product.uom_id.id:
                product_uom_obj = self.pool.get('product.uom')
                # Start kittiu
                #uom_data = product_uom_obj.browse(cr, uid,  product.uom_id.id)
                #factor = uom_data.factor
                uom_data = product_uom_obj.browse(cr, uid, uom)
                factor = 1 / uom_data.factor
                # End kittiu

addons/product_visible_discount/product_visible_discount.py, around line 68
-------------------------------------------------------------------------------------------------------------------------------------
        res=super(sale_order_line, self).product_id_change(cr, uid, ids, pricelist, product, qty,
            uom, qty_uos, uos, name, partner_id,
            lang, update_tax, date_order, packaging=packaging, fiscal_position=fiscal_position, flag=flag, context=context)

        # Start kittiu
        # In some case, the uom was reset after super class call.
        uom = res['value'].get('product_uom')
        # End kittiu


I have test it with Sales Order.

Regards,
Kitti U.

-- 
You received this bug notification because you are a member of OpenERP
Indian Team, which is subscribed to OpenERP Addons.
https://bugs.launchpad.net/bugs/1082409

Title:
  Can not change UOM on Sales Order Line

Status in OpenERP Addons (modules):
  In Progress

Bug description:
  Step:
  ====
  1. Setting Sales Configuration --> Allow using different units of measures
  2. Create new Sales Order
  3. Add an Order Line, i.e., Adapter 1 Unit = 18 Euro
  4. Change UOM to 1 Dozen = 216 Euro

  The UOM set back to 1 Unit, but the price still 216 Euro !!!!

To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-addons/+bug/1082409/+subscriptions


References