[IMP] stock : Set the default value for 'Source Location' and 'Destination Location...
authorDivyesh Makwana (Open ERP) <mdi@tinyerp.com>
Thu, 27 Sep 2012 12:15:03 +0000 (17:45 +0530)
committerDivyesh Makwana (Open ERP) <mdi@tinyerp.com>
Thu, 27 Sep 2012 12:15:03 +0000 (17:45 +0530)
bzr revid: mdi@tinyerp.com-20120927121503-mmy2lg7ocdfjd7pd

addons/stock/stock.py

index b015a65..7306176 100644 (file)
@@ -1724,12 +1724,10 @@ class stock_move(osv.osv):
             location_id = property_out and property_out.id or False
         else:
             location_xml_id = False
-            if picking_type == 'in':
+            if picking_type in ('in', 'internal'):
                 location_xml_id = 'stock_location_stock'
             elif picking_type == 'out':
                 location_xml_id = 'stock_location_customers'
-            elif picking_type == 'internal':
-                location_xml_id = 'stock_location_stock'
             if location_xml_id:
                 location_model, location_id = mod_obj.get_object_reference(cr, uid, 'stock', location_xml_id)
         return location_id
@@ -1757,9 +1755,7 @@ class stock_move(osv.osv):
             location_xml_id = False
             if picking_type == 'in':
                 location_xml_id = 'stock_location_suppliers'
-            elif picking_type == 'out':
-                location_xml_id = 'stock_location_stock'
-            elif picking_type == 'internal':
+            elif picking_type in ('out', 'internal'):
                 location_xml_id = 'stock_location_stock'
             if location_xml_id:
                 location_model, location_id = mod_obj.get_object_reference(cr, uid, 'stock', location_xml_id)