[IMP] route_id -> route_ids on warehouse

bzr revid: jco@openerp.com-20130925152225-2tpkq0dryrfrf0kb
This commit is contained in:
Josse Colpaert 2013-09-25 17:22:25 +02:00
parent 0ab7f40e0a
commit e69105031e
3 changed files with 6 additions and 6 deletions

View File

@ -36,10 +36,10 @@ class sale_order(osv.osv):
'''
res = super(sale_order, self)._prepare_order_line_procurement(cr, uid, order, line, group_id=group_id, context=context)
routes = []
route_id = order.warehouse_id and order.warehouse_id.route_id and order.warehouse_id.route_id.id or False
routes += route_id and [(4, route_id)] or []
route_id = line.route_id and line.route_id.id or False
routes += route_id and [(4, route_id)] or []
route_ids = order.warehouse_id and [(4, x.id) for x in order.warehouse_id.route_ids] or []
routes += route_ids
route_id = line.route_id and [(4, line.route_id.id)] or []
routes += route_id
res.update({
'route_ids': routes
})

View File

@ -41,7 +41,7 @@ class stock_location_route(osv.osv):
class stock_warehouse(osv.osv):
_inherit = 'stock.warehouse'
_columns = {
'route_id': fields.many2one('stock.location.route', 'Default Delivery Route', domain="[('warehouse_selectable', '=', True)]", help='Default route through the warehouse'),
'route_ids': fields.many2many('stock.location.route', 'stock_route_warehouse', 'warehouse_id', 'route_id', 'Routes', domain="[('warehouse_selectable', '=', True)]", help='Defaults routes through the warehouse'),
}

View File

@ -181,7 +181,7 @@
<field name="inherit_id" ref="stock.view_warehouse"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='partner_id']" position="after">
<field name="route_id" attrs="{'invisible': [('route_id', '=', False)]}"/>
<field name="route_ids" attrs="{'invisible': [('route_id', '=', False)]}"/>
</xpath>
<xpath expr="//group[last()]" position="after">