summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGoffin Simon <sig@odoo.com>2016-03-18 14:58:09 +0100
committerGoffin Simon <sig@odoo.com>2016-03-21 10:44:00 +0100
commitcc335879a7d47ca376bc33fbe85d2ecfb1b2a94b (patch)
treef9c86ff8127fddeb4e668810b8e8909a044d2fd1
parent9df29217436b81f0d479a3614ed35f72e85d8402 (diff)
[FIX] sale_stock: _check_routing in drop shipping
When checking the route of a product, if the product is set with route drop shipping then the product is available. Inspired from 14fd46c0d59dbb0365019a21bf1263b17ab99dbb opw:672392
-rw-r--r--addons/sale_stock/sale_stock.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/addons/sale_stock/sale_stock.py b/addons/sale_stock/sale_stock.py
index 60bea3e4ff5..bb38c0e5890 100644
--- a/addons/sale_stock/sale_stock.py
+++ b/addons/sale_stock/sale_stock.py
@@ -290,6 +290,13 @@ class sale_order_line(osv.osv):
if product_route.id == mto_route_id:
is_available = True
break
+ if not is_available:
+ product_routes = product.route_ids + product.categ_id.total_route_ids
+ for pull_rule in product_routes.mapped('pull_ids'):
+ if pull_rule.picking_type_id.sudo().default_location_src_id.usage == 'supplier' and\
+ pull_rule.picking_type_id.sudo().default_location_dest_id.usage == 'customer':
+ is_available = True
+ break
return is_available
def product_id_change_with_wh(self, cr, uid, ids, pricelist, product, qty=0,