ajay javiya (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/trunk-addons7-change-qty-aja into 
lp:~openerp-dev/openobject-addons/trunk-addons7.

Requested reviews:
  Jigar Amin  (OpenERP) (jam-openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-addons7-change-qty-aja/+merge/122487

Hello, 
=>"Change qty" wizard that is not come after Waiting Goods state.
=> when change qty ,update procurement orders or internal picking.
Thank You
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-addons7-change-qty-aja/+merge/122487
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-addons7.
=== modified file 'mrp/mrp_view.xml'
--- mrp/mrp_view.xml	2012-09-03 10:34:51 +0000
+++ mrp/mrp_view.xml	2012-09-03 10:34:55 +0000
@@ -623,6 +623,7 @@
                     <h1>
                         <field name="product_id" on_change="product_id_change(product_id)" domain="[('bom_ids','&lt;&gt;',False),('bom_ids.bom_id','=',False)]" class="oe_inline"/>
                     </h1>
+<<<<<<< TREE
                     <group>
                         <group>
                             <label for="product_qty" class="oe_edit_only"/>
@@ -644,6 +645,17 @@
                             </h2>
                         </group>
                     </group>
+=======
+                    <label for="product_qty" class="oe_edit_only"/>
+                    <h2>
+                        <field name="product_qty" class="oe_inline"/>
+                        <field name="product_uom" groups="product.group_uom" class="oe_inline"/>
+                        <button type="action"
+                            icon="terp-accessories-archiver+"
+                            name="%(mrp.action_change_production_qty)d"
+                            string="Change Qty" states="draft,cancel,confirmed,picking_except" class="oe_inline"/>
+                    </h2>
+>>>>>>> MERGE-SOURCE
                     <div groups="mrp.group_mrp_routings">
                         <label for="routing_id" class="oe_edit_only"/>
                         <h2><field name="routing_id" class="oe_inline"/></h2>

=== modified file 'mrp/wizard/change_production_qty.py'
--- mrp/wizard/change_production_qty.py	2012-08-06 17:08:41 +0000
+++ mrp/wizard/change_production_qty.py	2012-09-03 10:34:55 +0000
@@ -68,12 +68,12 @@
         assert record_id, _('Active Id not found')
         prod_obj = self.pool.get('mrp.production')
         bom_obj = self.pool.get('mrp.bom')
+        move_lines_obj = self.pool.get('stock.move')
         for wiz_qty in self.browse(cr, uid, ids, context=context):
             prod = prod_obj.browse(cr, uid, record_id, context=context)
             prod_obj.write(cr, uid, [prod.id], {'product_qty': wiz_qty.product_qty})
             prod_obj.action_compute(cr, uid, [prod.id])
 
-            move_lines_obj = self.pool.get('stock.move')
             for move in prod.move_lines:
                 bom_point = prod.bom_id
                 bom_id = prod.bom_id.id
@@ -89,11 +89,17 @@
 
                 factor = prod.product_qty * prod.product_uom.factor / bom_point.product_uom.factor
                 res = bom_obj._bom_explode(cr, uid, bom_point, factor / bom_point.product_qty, [])
+                pick_move = {}
+                for move_ln in prod.picking_id.move_lines:
+                    pick_move.update({move_ln.product_id.id: move_ln.id})
                 for r in res[0]:
                     if r['product_id'] == move.product_id.id:
                         move_lines_obj.write(cr, uid, [move.id], {'product_qty' :  r['product_qty']})
+                    if r['product_id'] in pick_move:
+                        move_lines_obj.write(cr, uid, [pick_move[r['product_id']]], {'product_qty' :  r['product_qty']})
+            if prod.move_prod_id:
+                move_lines_obj.write(cr, uid, [prod.move_prod_id.id], {'product_qty' :  wiz_qty.product_qty})
             self._update_product_to_produce(cr, uid, prod, wiz_qty.product_qty, context=context)
-
         return {}
 
 change_production_qty()

_______________________________________________
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