[FIX] purchase: a procurement is done if all moves related are done
In case of a partial delivery of the products to receive, the procurement is not considered as done since procurement.purchase_line_id.order_id.shipped is false. opw-641503
This commit is contained in:
parent
22ded0df6b
commit
c7fad1313a
|
@ -1238,8 +1238,12 @@ class procurement_order(osv.osv):
|
|||
return super(procurement_order, self)._run(cr, uid, procurement, context=context)
|
||||
|
||||
def _check(self, cr, uid, procurement, context=None):
|
||||
if procurement.purchase_line_id and procurement.purchase_line_id.order_id.shipped: # TOCHECK: does it work for several deliveries?
|
||||
return True
|
||||
if procurement.purchase_line_id:
|
||||
if procurement.purchase_line_id.order_id.shipped:
|
||||
return True
|
||||
elif procurement.move_ids:
|
||||
moves = self.pool.get('stock.move').browse(cr, uid, [x.id for x in procurement.move_ids], context=context)
|
||||
return all(move.state == 'done' for move in moves)
|
||||
return super(procurement_order, self)._check(cr, uid, procurement, context=context)
|
||||
|
||||
def _check_supplier_info(self, cr, uid, ids, context=None):
|
||||
|
|
Loading…
Reference in New Issue