'Checking rules of type \'move\': satisfied only if all related moves
are done/cancel and if the requested quantity is moved.'

@api.multi
def _check(self):

    if (self.rule_id.action == 'move'):
        if (not self.move_ids):
            return True
        move_all_done_or_cancel = all(((move.state in ['done', 'cancel']) for move in self.move_ids))
        move_all_cancel = all(((move.state == 'cancel') for move in self.move_ids))
        if (not move_all_done_or_cancel):
            return False
        elif (move_all_done_or_cancel and (not move_all_cancel)):
            return True
        else:
            self.message_post(body=_('All    stock    moves    have    been    cancelled    for    this    procurement.'))
            self.write({'state': 'cancel'})
            return False
    return super(ProcurementOrder, self)._check()
