[FIX] project_mrp: revert addition in commit 9445 breaking databases withtout mrp module
bzr revid: mat@openerp.com-20130917160918-dohb1lb5vtqsy5lv
This commit is contained in:
parent
c0be2ae2a7
commit
bdf2395e3a
|
@ -108,23 +108,3 @@ class sale_order(osv.osv):
|
|||
'picked_rate': fields.function(_picked_rate, method=True, string='Picked', type='float'),
|
||||
}
|
||||
|
||||
sale_order()
|
||||
|
||||
class mrp_production(osv.osv):
|
||||
_inherit = 'mrp.production'
|
||||
|
||||
def _hook_create_post_procurement(self, cr, uid, production, procurement_id, context=None):
|
||||
def get_parent_move(move):
|
||||
if move.move_dest_id:
|
||||
return get_parent_move(move.move_dest_id)
|
||||
return move
|
||||
|
||||
res = super(mrp_production, self)._hook_create_post_procurement(cr, uid, production, procurement_id, context)
|
||||
if production.move_prod_id:
|
||||
parent_move_line = get_parent_move(production.move_prod_id)
|
||||
if parent_move_line and parent_move_line.sale_line_id:
|
||||
self.pool.get('procurement.order').write(cr, uid, procurement_id, {'sale_line_id': parent_move_line.sale_line_id.id})
|
||||
return res
|
||||
|
||||
mrp_production()
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
Loading…
Reference in New Issue