[IMP] Performance improvement : if location_id already has the right value, we don...
authorAlexis de Lattre <alexis@via.ecp.fr>
Mon, 16 Apr 2012 08:47:14 +0000 (10:47 +0200)
committerAlexis de Lattre <alexis@via.ecp.fr>
Mon, 16 Apr 2012 08:47:14 +0000 (10:47 +0200)
bzr revid: alexis@via.ecp.fr-20120416084714-otfuezu6tjy533nt

addons/mrp/mrp.py

index 9ff3a64..90d43b8 100644 (file)
@@ -660,7 +660,7 @@ class mrp_production(osv.osv):
 
         for (production_id,name) in self.name_get(cr, uid, ids):
             production = self.browse(cr, uid, production_id)
-            if production.move_prod_id:
+            if production.move_prod_id and production.move_prod_id.location_id.id != production.location_dest_id.id:
                 move_obj.write(cr, uid, [production.move_prod_id.id],
                         {'location_id': production.location_dest_id.id})
             self.action_ready_send_note(cr, uid, [production_id], context)