[IMP] stock : Set the default value for 'Source Location' and 'Destination Location...
authorDivyesh Makwana (Open ERP) <mdi@tinyerp.com>
Thu, 27 Sep 2012 10:14:36 +0000 (15:44 +0530)
committerDivyesh Makwana (Open ERP) <mdi@tinyerp.com>
Thu, 27 Sep 2012 10:14:36 +0000 (15:44 +0530)
bzr revid: mdi@tinyerp.com-20120927101436-rl77urw5awl7qler

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

index 4dea3ab..b015a65 100644 (file)
@@ -1728,6 +1728,8 @@ class stock_move(osv.osv):
                 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,6 +1759,8 @@ class stock_move(osv.osv):
                 location_xml_id = 'stock_location_suppliers'
             elif picking_type == 'out':
                 location_xml_id = 'stock_location_stock'
+            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
index 8c7777d..d03a83d 100644 (file)
                     </group>
                     <notebook>
                         <page string="Products">
-                            <field name="move_lines" context="{'address_in_id': partner_id, 'form_view_ref':'view_move_picking_form', 'tree_view_ref':'view_move_picking_tree'}"/>
+                            <field name="move_lines" context="{'address_in_id': partner_id, 'form_view_ref':'view_move_picking_form', 'tree_view_ref':'view_move_picking_tree', 'picking_type': 'internal'}"/>
                         </page>
                         <page string="Additional Info">
                             <group>