Amit Dodiya (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/6.0-opw-572997-ado into 
lp:openobject-addons/6.0.

Requested reviews:
  Naresh(OpenERP) (nch-openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/6.0-opw-572997-ado/+merge/98581

Hello,

[FIX] stock : Fixing a uos qty problem

Steps:
1). Create a product with default_uom = g, quantity = 4000
2). Create sale order with above product with Quantity(UOM) = 4000 g, 
Quantity(UOS)=4 kg
3). Confirm the sale order, Open the related delivery order
4). Process it with Quantity = 500 g
5). Open the current delivery order line you will see the Quantity(UOM) = 3500 
g and 
Quantity(UOS) = 3500 kg, Quantity(UOS) should be 3.5 kg
6). Open the related backorder same issue here.

Code is Back-ported from trunk.

Regards,
Amit
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/6.0-opw-572997-ado/+merge/98581
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/6.0-opw-572997-ado.
=== modified file 'stock/stock.py'
--- stock/stock.py	2012-03-13 16:33:22 +0000
+++ stock/stock.py	2012-03-21 06:39:19 +0000
@@ -1243,6 +1243,7 @@
 
 
             for move in too_few:
+                uom_uos_diff = move.product_qty / move.product_uos_qty
                 product_qty = move_product_qty[move.id]
 
                 if not new_picking:
@@ -1255,7 +1256,7 @@
                 if product_qty != 0:
                     defaults = {
                             'product_qty' : product_qty,
-                            'product_uos_qty': product_qty, #TODO: put correct uos_qty
+                            'product_uos_qty': product_qty / uom_uos_diff,
                             'picking_id' : new_picking,
                             'state': 'assigned',
                             'move_dest_id': False,
@@ -1268,7 +1269,7 @@
                 move_obj.write(cr, uid, [move.id],
                         {
                             'product_qty' : move.product_qty - product_qty,
-                            'product_uos_qty':move.product_qty - product_qty, #TODO: put correct uos_qty
+                            'product_uos_qty': (move.product_qty - product_qty) / uom_uos_diff,
                         })
 
             if new_picking:

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to