[IMP]:task-1773 improvement by given comment
authorksa (Open ERP) <ksa@tinyerp.co.in>
Thu, 18 Nov 2010 06:47:12 +0000 (12:17 +0530)
committerksa (Open ERP) <ksa@tinyerp.co.in>
Thu, 18 Nov 2010 06:47:12 +0000 (12:17 +0530)
bzr revid: ksa@tinyerp.co.in-20101118064712-zuuj9wim9h140olk

addons/stock/stock.py
addons/stock/stock_view.xml

index ad7c98f..4f44490 100644 (file)
@@ -2416,7 +2416,10 @@ class stock_inventory(osv.osv):
         return self.pool.get('stock.move').create(cr, uid, move_vals)
 
     def action_done(self, cr, uid, ids, context=None):
-        self.write(cr, uid, ids, {'state':'done'} ,context=context)
+        move_obj = self.pool.get('stock.move')
+        for inv in self.browse(cr,uid,ids):
+            move_obj.action_done(cr, uid, [x.id for x in inv.move_ids], context)
+            self.write(cr, uid, [inv.id], {'state':'done'}, context=context)
         return True
 
     def action_confirm(self, cr, uid, ids, context=None):
@@ -2448,7 +2451,6 @@ class stock_inventory(osv.osv):
                         'prodlot_id': lot_id,
                         'date': inv.date,
                         'date': inv.date,
-                        'state': 'done'
                     }
                     if change > 0:
                         value.update( {
index 5f5206a..3e70884 100644 (file)
                     <field name="state"/>
                     <group col="4" colspan="2">
                         <button name="action_cancel_inventary" states="draft" string="Cancel Inventory" type="object" icon="gtk-cancel"/>
-                        <button name="action_confirm" states="draft" string="Confirm Inventory" type="object" icon="gtk-apply"/>
-                        <button name="action_done" states="confirm" string="Done" type="object" icon="gtk-jump-to"/>
+                        <button name="action_confirm" states="draft" string="Validate Inventory" type="object" icon="gtk-apply"/>
+                        <button name="action_done" states="confirm" string="Confirm Inventory" type="object" icon="gtk-jump-to"/>
                         <button name="action_cancel" states="cancel" string="Set to Draft" type="object" icon="gtk-convert"/>
                     </group>