Can not change UOM on Sales Order Line

Bug #1082409 reported by Kitti Upariphutthiphong
30
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Committed
Medium
OpenERP R&D Addons Team 3

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 !!!!

Tags: needs-test

Related branches

Revision history for this message
Amit Parik (amit-parik) wrote :

Hello,

The exact problem is we could not set another uom properly on sale order line,.

Once you have to try to change the uom to dozen then price will update but uom won't set properly , you can see in on attached video.

Thank you!

Revision history for this message
Amit Parik (amit-parik) wrote :
Changed in openobject-addons:
assignee: nobody → OpenERP R&D Addons Team 3 (openerp-dev-addons3)
importance: Undecided → Medium
status: New → Confirmed
Changed in openobject-addons:
status: Confirmed → In Progress
Revision history for this message
Kitti Upariphutthiphong (kittiu) wrote :

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.

Revision history for this message
Kitti Upariphutthiphong (kittiu) wrote :

Further found also that, once the document is converted to Invoice, it is also incorrect.

For example, buying a product
Sales Order = 12 Unit, 1 Dozens
Delivery Order = receive 12 Unit
Customer INV = 12 Dozens !!!!!! (but the price still ok)

Changed in openobject-addons:
status: In Progress → Confirmed
Changed in openobject-addons:
status: Confirmed → In Progress
Revision history for this message
Hiral Patel (OpenERP) (hip-openerp) wrote :

Hello,

           It has been Fixed in http://bazaar.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-1082409-hip
           Revno: 8483
           Revision ID: <email address hidden>
Thanks,
hip

Changed in openobject-addons:
status: In Progress → Fix Committed
tags: added: needs-test
Revision history for this message
Nicolas JEUDY (njeudy) wrote :

Olivier: I test in on fresh 7.0 branch with only this patch and it works. I use it in production environnement for my customer without problem !.

Hope it could help :)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.