Rifakat (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/6.0-opw-17161-rha into 
lp:openobject-addons/6.0.

Requested reviews:
  OpenERP Core Team (openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/6.0-opw-17161-rha/+merge/74188

Hello,

Stock partial picking and partial move wizard is mixing the stock moves. 
Showing randomly stock moves of another order. There is only one foreign key 
reference 'wizard_id' for stock.partial.move and stock.partial.picking. Created 
two separate O2M fields for stock.partial.picking and stock.partial.move. Its 
solves the problem now.

Need experts view on this.

Regards,
Rifakat
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/6.0-opw-17161-rha/+merge/74188
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/6.0-opw-17161-rha.
=== modified file 'stock/wizard/stock_partial_move.py'
--- stock/wizard/stock_partial_move.py	2011-06-29 10:41:59 +0000
+++ stock/wizard/stock_partial_move.py	2011-09-06 09:30:26 +0000
@@ -24,24 +24,6 @@
 import time
 
 
-class stock_partial_move_memory_out(osv.osv_memory):
-    _name = "stock.move.memory.out"
-    _rec_name = 'product_id'
-    _columns = {
-        'product_id' : fields.many2one('product.product', string="Product", required=True),
-        'quantity' : fields.float("Quantity", required=True),
-        'product_uom': fields.many2one('product.uom', 'Unit of Measure', required=True),
-        'prodlot_id' : fields.many2one('stock.production.lot', 'Production Lot'),
-        'move_id' : fields.many2one('stock.move', "Move"),
-        'wizard_id' : fields.many2one('stock.partial.move', string="Wizard"),
-        'cost' : fields.float("Cost", help="Unit Cost for this product line"),
-        'currency' : fields.many2one('res.currency', string="Currency", help="Currency in which Unit cost is expressed"),
-    }
-    
-class stock_partial_move_memory_in(osv.osv_memory):
-    _inherit = "stock.move.memory.out"
-    _name = "stock.move.memory.in"
-    
 class stock_partial_move(osv.osv_memory):
     _name = "stock.partial.move"
     _description = "Partial Move"
@@ -220,7 +202,28 @@
         return {'type': 'ir.actions.act_window_close'}
 
 stock_partial_move()
+
+class stock_partial_move_memory_out(osv.osv_memory):
+    _name = "stock.move.memory.out"
+    _rec_name = 'product_id'
+    _columns = {
+        'product_id' : fields.many2one('product.product', string="Product", required=True),
+        'quantity' : fields.float("Quantity", required=True),
+        'product_uom': fields.many2one('product.uom', 'Unit of Measure', required=True),
+        'prodlot_id' : fields.many2one('stock.production.lot', 'Production Lot'),
+        'move_id' : fields.many2one('stock.move', "Move"),
+        'wizard_id' : fields.many2one('stock.partial.move', string="Wizard"),
+        'wizard_pick' : fields.many2one('stock.partial.picking', string="Wizard1"),
+        'cost' : fields.float("Cost", help="Unit Cost for this product line"),
+        'currency' : fields.many2one('res.currency', string="Currency", help="Currency in which Unit cost is expressed"),
+    }
+    
 stock_partial_move_memory_out()
+    
+class stock_partial_move_memory_in(osv.osv_memory):
+    _inherit = "stock.move.memory.out"
+    _name = "stock.move.memory.in"
+
 stock_partial_move_memory_in()
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
 

=== modified file 'stock/wizard/stock_partial_move_view.xml'
--- stock/wizard/stock_partial_move_view.xml	2011-01-14 15:01:33 +0000
+++ stock/wizard/stock_partial_move_view.xml	2011-09-06 09:30:26 +0000
@@ -81,5 +81,68 @@
             </field>
         </record>  
         
+        
+        <!-- Picking -->
+        
+        <record id="stock_pick_memory_tree_in" model="ir.ui.view">
+            <field name="name">stock.pick.memory.tree</field>
+            <field name="model">stock.pick.memory.in</field>
+            <field name="type">tree</field>
+            <field name="arch" type="xml">
+                <tree editable="bottom" string="Product Moves">
+                    <field name="product_id" />
+                    <field name="quantity" />
+                    <field name="product_uom" />
+                    <field name="prodlot_id" domain="[('product_id', '=', product_id)]" groups="base.group_extended" />
+                    <field name="cost" />
+                    <field name="currency" />
+                </tree>
+            </field>
+        </record>
+        
+        <record id="stock_pick_memory_form_in" model="ir.ui.view">
+            <field name="name">stock.pick.memory.form</field>
+            <field name="model">stock.pick.memory.in</field>
+            <field name="type">form</field>
+            <field name="arch" type="xml">
+                <form>
+                    <field name="product_id" />
+                    <field name="quantity" />
+                    <field name="product_uom" />
+                    <field name="prodlot_id" domain="[('product_id', '=', product_id)]" groups="base.group_extended" />
+                    <field name="cost" />
+                    <field name="currency" />
+                 </form>
+            </field>
+        </record>   
+        
+        <record id="stock_pick_memory_tree_out" model="ir.ui.view">
+            <field name="name">stock.pick.memory.tree</field>
+            <field name="model">stock.pick.memory.out</field>
+            <field name="type">tree</field>
+            <field name="arch" type="xml">
+                <tree editable="bottom" string="Product Moves">
+                    <field name="product_id" />
+                    <field name="quantity" />
+                    <field name="product_uom" />
+                    <field name="prodlot_id" domain="[('product_id', '=', product_id)]"  groups="base.group_extended" />
+                </tree>
+            </field>
+        </record>
+        
+        <record id="stock_pick_memory_form_out" model="ir.ui.view">
+            <field name="name">stock.pick.memory.form</field>
+            <field name="model">stock.pick.memory.out</field>
+            <field name="type">form</field>
+            <field name="arch" type="xml">
+                <form>
+                    <field name="product_id" />
+                    <field name="quantity" />
+                    <field name="product_uom" />
+                    <field name="prodlot_id" domain="[('product_id', '=', product_id)]" groups="base.group_extended" />
+                </form>
+            </field>
+        </record>  
+        
     </data>
 </openerp>

=== modified file 'stock/wizard/stock_partial_picking.py'
--- stock/wizard/stock_partial_picking.py	2011-09-01 16:55:42 +0000
+++ stock/wizard/stock_partial_picking.py	2011-09-06 09:30:26 +0000
@@ -29,8 +29,8 @@
     _description = "Partial Picking"
     _columns = {
         'date': fields.datetime('Date', required=True),
-        'product_moves_out' : fields.one2many('stock.move.memory.out', 'wizard_id', 'Moves'),
-        'product_moves_in' : fields.one2many('stock.move.memory.in', 'wizard_id', 'Moves'),
+        'product_pick_out' : fields.one2many('stock.pick.memory.out', 'wizard_pick_id', 'Moves'),
+        'product_pick_in' : fields.one2many('stock.pick.memory.in', 'wizard_pick_id', 'Moves'),
      }
 
     def get_picking_type(self, cr, uid, picking, context=None):
@@ -69,10 +69,10 @@
                     continue
                 result.append(self.__create_partial_picking_memory(m, pick_type))
 
-        if 'product_moves_in' in fields:
-            res.update({'product_moves_in': result})
-        if 'product_moves_out' in fields:
-            res.update({'product_moves_out': result})
+        if 'product_pick_in' in fields:
+            res.update({'product_pick_in': result})
+        if 'product_pick_out' in fields:
+            res.update({'product_pick_out': result})
         if 'date' in fields:
             res.update({'date': time.strftime('%Y-%m-%d %H:%M:%S')})
         return res
@@ -94,12 +94,12 @@
                         <field name="date" invisible="1"/>
                         <separator colspan="4" string="%s"/>
                         <field name="%s" colspan="4" nolabel="1" mode="tree,form" width="550" height="200" ></field>
-                        """ % (_('Process Document'), _('Products'), "product_moves_" + picking_type)
+                        """ % (_('Process Document'), _('Products'), "product_pick_" + picking_type)
         _moves_fields = result['fields']
 
         # add field related to picking type only
         _moves_fields.update({
-                            'product_moves_' + picking_type: {'relation': 'stock.move.memory.'+picking_type, 'type' : 'one2many', 'string' : 'Product Moves'},
+                            'product_pick_' + picking_type: {'relation': 'stock.pick.memory.'+picking_type, 'type' : 'one2many', 'string' : 'Product Moves'},
                             })
 
         _moves_arch_lst += """
@@ -152,7 +152,7 @@
 
         for pick in pick_obj.browse(cr, uid, picking_ids, context=context):
             picking_type = self.get_picking_type(cr, uid, pick, context=context)
-            moves_list = picking_type == 'in' and partial.product_moves_in or partial.product_moves_out
+            moves_list = picking_type == 'in' and partial.product_pick_in or partial.product_pick_out
 
             for move in moves_list:
 
@@ -193,4 +193,26 @@
 
 stock_partial_picking()
 
+class stock_partial_pick_memory_out(osv.osv_memory):
+    _name = "stock.pick.memory.out"
+    _rec_name = 'product_id'
+    _columns = {
+        'product_id' : fields.many2one('product.product', string="Product", required=True),
+        'quantity' : fields.float("Quantity", required=True),
+        'product_uom': fields.many2one('product.uom', 'Unit of Measure', required=True),
+        'prodlot_id' : fields.many2one('stock.production.lot', 'Production Lot'),
+        'move_id' : fields.many2one('stock.move', "Move"),
+        'wizard_pick_id' : fields.many2one('stock.partial.picking', string="Picking wizard"),
+        'cost' : fields.float("Cost", help="Unit Cost for this product line"),
+        'currency' : fields.many2one('res.currency', string="Currency", help="Currency in which Unit cost is expressed"),
+    }
+    
+stock_partial_pick_memory_out()
+    
+class stock_partial_pick_memory_in(osv.osv_memory):
+    _inherit = "stock.pick.memory.out"
+    _name = "stock.pick.memory.in"
+
+stock_partial_pick_memory_in()
+
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

_______________________________________________
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