From f5ad729ab5c1ee6b9b9bfbf48e6aef36dddfd329 Mon Sep 17 00:00:00 2001 From: Josse Colpaert Date: Fri, 6 Sep 2013 13:54:02 +0200 Subject: [PATCH] [IMP] Add checkboxes on routes bzr revid: jco@openerp.com-20130906115402-195wsif9wg6z6cgh --- addons/sale_stock_location/sale_stock_location.py | 4 ++-- .../sale_stock_location_view.xml | 15 +++++++++++++-- .../stock_complex_routes/stock_complex_routes.xml | 9 +++++++-- .../test/procurementexception.yml | 2 +- addons/stock_location/stock_location.py | 9 ++++++--- addons/stock_location/stock_location_data.xml | 9 ++++++++- addons/stock_location/stock_location_view.xml | 8 ++++++++ 7 files changed, 45 insertions(+), 11 deletions(-) diff --git a/addons/sale_stock_location/sale_stock_location.py b/addons/sale_stock_location/sale_stock_location.py index 6cbde59ef2d..212b53c5996 100644 --- a/addons/sale_stock_location/sale_stock_location.py +++ b/addons/sale_stock_location/sale_stock_location.py @@ -48,14 +48,14 @@ class sale_order(osv.osv): class sale_order_line(osv.osv): _inherit = 'sale.order.line' _columns = { - 'route_id': fields.many2one('stock.location.route', 'Route', domain=[('sale', '=', True)]), + 'route_id': fields.many2one('stock.location.route', 'Route', domain=[('sale_selectable', '=', True)]), } class stock_location_route(osv.osv): _inherit = "stock.location.route" _columns = { - 'sale':fields.boolean("Can be set on sale order line") + 'sale_selectable':fields.boolean("Selectable on Sales Order Line") } diff --git a/addons/sale_stock_location/sale_stock_location_view.xml b/addons/sale_stock_location/sale_stock_location_view.xml index 7fd0f1853b2..de643a2f917 100644 --- a/addons/sale_stock_location/sale_stock_location_view.xml +++ b/addons/sale_stock_location/sale_stock_location_view.xml @@ -44,10 +44,21 @@ stock.location.route - - + + + + stock.location.route.tree.inherit + + stock.location.route + + + + + + + diff --git a/addons/stock_complex_routes/stock_complex_routes.xml b/addons/stock_complex_routes/stock_complex_routes.xml index 0591622dbe7..496a0144c37 100644 --- a/addons/stock_complex_routes/stock_complex_routes.xml +++ b/addons/stock_complex_routes/stock_complex_routes.xml @@ -23,7 +23,8 @@ Drop Shipping 3 - True + + @@ -40,7 +41,9 @@ Crossdock - True + + + Supplier → Output @@ -50,5 +53,7 @@ + + diff --git a/addons/stock_complex_routes/test/procurementexception.yml b/addons/stock_complex_routes/test/procurementexception.yml index e5c7dbfd72c..018795d1fc7 100644 --- a/addons/stock_complex_routes/test/procurementexception.yml +++ b/addons/stock_complex_routes/test/procurementexception.yml @@ -60,4 +60,4 @@ sale_id = self.pool.get('sale.order').browse(cr, uid, ref("sale_order_route_crossdock")) proc_ids = self.search(cr, uid, [('group_id.name', '=', sale_id.name)]) purchase_id = [proc.purchase_id for proc in self.browse(cr, uid, proc_ids) if proc.purchase_id] - assert purchase_id, 'No Purchase Quotation is created' + assert purchase_id, 'No Purchase Quotation is created' \ No newline at end of file diff --git a/addons/stock_location/stock_location.py b/addons/stock_location/stock_location.py index 5a4f4b8a9f1..46ecd325f52 100644 --- a/addons/stock_location/stock_location.py +++ b/addons/stock_location/stock_location.py @@ -34,6 +34,9 @@ class stock_location_route(osv.osv): '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'), + 'product_selectable': fields.boolean('Selectable on Product'), + 'product_categ_selectable': fields.boolean('Selectable on Product Category'), + 'warehouse_selectable': fields.boolean('Selectable on Warehouse'), } _defaults = { 'sequence': lambda self,cr,uid,ctx: 0, @@ -42,7 +45,7 @@ class stock_location_route(osv.osv): class stock_warehouse(osv.osv): _inherit = 'stock.warehouse' _columns = { - 'route_id': fields.many2one('stock.location.route', 'Default Routes', help='Default route through the warehouse', required=True), + 'route_id': fields.many2one('stock.location.route', 'Default Routes', domain="[('warehouse_selectable', '=', True)]", help='Default route through the warehouse', required=True), } @@ -201,13 +204,13 @@ class product_removal_strategy(osv.osv): class product_product(osv.osv): _inherit = 'product.product' _columns = { - 'route_ids': fields.many2many('stock.location.route', 'stock_location_route_product', 'product_id', 'route_id', 'Routes'), + 'route_ids': fields.many2many('stock.location.route', 'stock_location_route_product', 'product_id', 'route_id', 'Routes', domain="[('product_selectable', '=', True)]"), } class product_category(osv.osv): _inherit = 'product.category' _columns = { - 'route_ids': fields.many2many('stock.location.route', 'stock_location_route_categ', 'categ_id', 'route_id', 'Routes'), + 'route_ids': fields.many2many('stock.location.route', 'stock_location_route_categ', 'categ_id', 'route_id', 'Routes', domain="[('product_categ_selectable', '=', True)]"), 'removal_strategy_ids': fields.one2many('product.removal', 'product_categ_id', 'Removal Strategies'), #'putaway_strategy_ids': fields.one2many('product.putaway', 'product_categ_id', 'Put Away Strategies'), } diff --git a/addons/stock_location/stock_location_data.xml b/addons/stock_location/stock_location_data.xml index c5f438b920a..042f9571f3f 100644 --- a/addons/stock_location/stock_location_data.xml +++ b/addons/stock_location/stock_location_data.xml @@ -24,6 +24,7 @@ Sale: Ship only 20 + @@ -49,8 +50,10 @@ - Produce or buy on Customer Order + MTO 10 + + @@ -66,6 +69,8 @@ Crossdock 9 + + @@ -81,6 +86,7 @@ Sale: Pack + Ship 15 + @@ -130,6 +136,7 @@ Sale: Pick + Pack + Ship 20 + diff --git a/addons/stock_location/stock_location_view.xml b/addons/stock_location/stock_location_view.xml index c6d441e6930..cfd5a858d82 100644 --- a/addons/stock_location/stock_location_view.xml +++ b/addons/stock_location/stock_location_view.xml @@ -166,6 +166,9 @@ + + + @@ -178,6 +181,11 @@
+ + + + +