[WIP] Add boolean sale on route which is used as a domain for the route on the sales order line

bzr revid: jco@openerp.com-20130718092754-hl8i6rw0dm0che1t
This commit is contained in:
Josse Colpaert 2013-07-18 11:27:54 +02:00
parent bb6b684688
commit d820209ea5
4 changed files with 19 additions and 6 deletions

View File

@ -48,10 +48,16 @@ class sale_order(osv.osv):
class sale_order_line(osv.osv):
_inherit = 'sale.order.line'
_columns = {
'route_id': fields.many2one('stock.location.route', 'Route'),
'route_id': fields.many2one('stock.location.route', 'Route', domain=[('sale', '=', True)]),
}
class stock_location_route(osv.osv):
_inherit = "stock.location.route"
_columns = {
'sale':fields.boolean("Can be set on sale order line")
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -34,5 +34,16 @@
</xpath>
</field>
</record>
<record id="stock_location_route_form_view_inherit" model="ir.ui.view">
<field name="name">stock.location.route.form</field>
<field name="inherit_id" ref="stock_location.stock_location_route_form_view"/>
<field name="model">stock.location.route</field>
<field name="arch" type="xml">
<xpath expr="//field[@name='pull_ids']" position="after">
<field name="sale"/>
</xpath>
</field>
</record>
</data>
</openerp>

View File

@ -1676,11 +1676,6 @@ class stock_move(osv.osv):
#If no other moves for the move that got pushed:
if not other_upstream_move_ids and move.move_dest_id.state in ('waiting', 'confirmed'):
self.action_assign(cr, uid, [move.move_dest_id.id], context=context)
# quants = quant_obj.search(cr, uid, [('history_ids', 'in', move.id), ('location_id', '=', move.location_dest_id.id), ('reservation_id', '=', False)], context=context)
# if quants:
# quant_obj.write(cr, uid, quants, {'reservation_id':move.move_dest_id.id}, context=context)
self.write(cr, uid, ids, {'state': 'done', 'date': time.strftime(DEFAULT_SERVER_DATETIME_FORMAT)}, context=context)
if move.picking_id:

View File

@ -5,6 +5,7 @@
<record id="route_drop_shipping" model='stock.location.route'>
<field name="name">Drop Shipping</field>
<field name="sequence">3</field>
<field name="sale">True</field>
</record>
<record id="procurement_rule_drop_shipping" model="procurement.rule">