diff --git a/addons/stock/stock_view.xml b/addons/stock/stock_view.xml
index e76ce99855c..4488074293e 100644
--- a/addons/stock/stock_view.xml
+++ b/addons/stock/stock_view.xml
@@ -493,6 +493,7 @@
stock.warehouse
diff --git a/addons/stock_location/stock_location.py b/addons/stock_location/stock_location.py
index 5e58b918cb6..77d1a67149a 100644
--- a/addons/stock_location/stock_location.py
+++ b/addons/stock_location/stock_location.py
@@ -28,20 +28,29 @@ class stock_location_route(osv.osv):
_name = 'stock.location.route'
_description = "Inventory Routes"
_order = 'sequence'
+
+ def _default_warehouse(self, cr, uid, context=None):
+ user = self.pool.get('res.users').browse(cr, uid, uid, context)
+ res = self.pool.get('stock.warehouse').search(cr, uid, [('company_id', '=', user.company_id.id)], limit=1, context=context)
+ return res and res[0] or False
+
_columns = {
'name': fields.char('Route Name', required=True),
'sequence': fields.integer('Sequence'),
'pull_ids': fields.one2many('procurement.rule', 'route_id', 'Pull Rules'),
'push_ids': fields.one2many('stock.location.path', 'route_id', 'Push Rules'),
+ 'warehouse_id': fields.many2one('stock.warehouse', 'Warehouse'),
}
_defaults = {
'sequence': lambda self,cr,uid,ctx: 0,
+ 'warehouse_id': _default_warehouse,
}
class stock_warehouse(osv.osv):
_inherit = 'stock.warehouse'
_columns = {
'route_id': fields.many2one('stock.location.route', 'Default Logistic Route', help='Default route through the warehouse', required=True),
+ 'route_ids': fields.one2many('stock.location.route', 'warehouse_id', 'All Routes'),
}
diff --git a/addons/stock_location/stock_location_view.xml b/addons/stock_location/stock_location_view.xml
index c50a6ca8a94..6c5cc042fef 100644
--- a/addons/stock_location/stock_location_view.xml
+++ b/addons/stock_location/stock_location_view.xml
@@ -157,6 +157,14 @@
+
+
+
+
+
+
+
+
@@ -167,6 +175,7 @@
+
@@ -179,6 +188,7 @@