diff --git a/addons/stock/stock.py b/addons/stock/stock.py index b922a3c5566..4e1d4310b6d 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -2395,7 +2395,9 @@ class stock_picking_type(osv.osv): return res reads = self.browse(cr, uid, ids, context=context) for record in reads: - name = record.warehouse_id.name+': '+record.name + name = record.name + if record.warehouse_id: + name = record.warehouse_id.name+': '+name res.append((record.id, name)) return res @@ -2415,7 +2417,7 @@ class stock_picking_type(osv.osv): 'default_location_dest_id': fields.many2one('stock.location', 'Default Destination Location'), 'code_id': fields.selection([('incoming', 'Suppliers'), ('outgoing', 'Customers'), ('internal', 'Internal')], 'Picking type code', required=True), 'return_picking_type_id': fields.many2one('stock.picking.type', 'Picking Type for Returns'), - 'warehouse_id': fields.many2one('stock.warehouse', 'Warehouse', required=True), + 'warehouse_id': fields.many2one('stock.warehouse', 'Warehouse'), # Statistics for the kanban view 'weekly_picking': fields.function(_get_picking_data, diff --git a/addons/stock_location/stock_location.py b/addons/stock_location/stock_location.py index e052063cc3c..bedf59baf1e 100644 --- a/addons/stock_location/stock_location.py +++ b/addons/stock_location/stock_location.py @@ -29,28 +29,20 @@ class stock_location_route(osv.osv): _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_data.xml b/addons/stock_location/stock_location_data.xml index b282fcbf08c..c5f438b920a 100644 --- a/addons/stock_location/stock_location_data.xml +++ b/addons/stock_location/stock_location_data.xml @@ -22,7 +22,7 @@ --> - Ship only + Sale: Ship only 20 @@ -79,7 +79,7 @@ - Pack + Ship + Sale: Pack + Ship 15 @@ -128,7 +128,7 @@ - Pick + Pack + Ship + Sale: Pick + Pack + Ship 20 diff --git a/addons/stock_location/stock_location_view.xml b/addons/stock_location/stock_location_view.xml index 34213638b84..f74b2d9321b 100644 --- a/addons/stock_location/stock_location_view.xml +++ b/addons/stock_location/stock_location_view.xml @@ -156,14 +156,6 @@ - - - - - - - - @@ -174,7 +166,6 @@ - @@ -187,7 +178,6 @@
-